zdjęcia się wyświetlają na karcie produktu
This commit is contained in:
@@ -61,7 +61,7 @@ export default function NoticeDetails() {
|
||||
);
|
||||
|
||||
const isInWishlist = useWishlist((state) =>
|
||||
id ? state.wishlistNotices.some((item) => item.noticeId == id) : false
|
||||
id ? state.wishlistNotices.some((item) => item.noticeId === id) : false
|
||||
);
|
||||
const onViewableItemsChanged = useRef(({viewableItems}) => {
|
||||
if (viewableItems.length > 0) {
|
||||
@@ -103,11 +103,11 @@ export default function NoticeDetails() {
|
||||
setImages(
|
||||
fetchedImages && fetchedImages.length > 0
|
||||
? fetchedImages
|
||||
: ["https://http.cat/404.jpg"]
|
||||
: {uri: "https://http.cat/404.jpg"}
|
||||
);
|
||||
} catch (err) {
|
||||
console.error("Error while loading images:", err);
|
||||
setImage("https://http.cat/404.jpg");
|
||||
setImage({uri: "https://http.cat/404.jpg"});
|
||||
} finally {
|
||||
setIsImageLoading(false);
|
||||
}
|
||||
@@ -173,10 +173,10 @@ export default function NoticeDetails() {
|
||||
onViewableItemsChanged={onViewableItemsChanged}
|
||||
viewabilityConfig={viewabilityConfig}
|
||||
renderItem={({item, index}) => (
|
||||
<View style={{ width: width }}>
|
||||
<View style={{width: width}} className='p-2'>
|
||||
<Image
|
||||
source={{ uri: item }}
|
||||
className="h-auto w-full rounded-md aspect-square"
|
||||
source={item}
|
||||
className="h-auto w-auto rounded-md aspect-[1/1]"
|
||||
alt={`Zdjęcie ${index + 1}`}
|
||||
resizeMode="contain"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user