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) =>
|
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}) => {
|
const onViewableItemsChanged = useRef(({viewableItems}) => {
|
||||||
if (viewableItems.length > 0) {
|
if (viewableItems.length > 0) {
|
||||||
@@ -103,11 +103,11 @@ export default function NoticeDetails() {
|
|||||||
setImages(
|
setImages(
|
||||||
fetchedImages && fetchedImages.length > 0
|
fetchedImages && fetchedImages.length > 0
|
||||||
? fetchedImages
|
? fetchedImages
|
||||||
: ["https://http.cat/404.jpg"]
|
: {uri: "https://http.cat/404.jpg"}
|
||||||
);
|
);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("Error while loading images:", err);
|
console.error("Error while loading images:", err);
|
||||||
setImage("https://http.cat/404.jpg");
|
setImage({uri: "https://http.cat/404.jpg"});
|
||||||
} finally {
|
} finally {
|
||||||
setIsImageLoading(false);
|
setIsImageLoading(false);
|
||||||
}
|
}
|
||||||
@@ -173,10 +173,10 @@ export default function NoticeDetails() {
|
|||||||
onViewableItemsChanged={onViewableItemsChanged}
|
onViewableItemsChanged={onViewableItemsChanged}
|
||||||
viewabilityConfig={viewabilityConfig}
|
viewabilityConfig={viewabilityConfig}
|
||||||
renderItem={({item, index}) => (
|
renderItem={({item, index}) => (
|
||||||
<View style={{ width: width }}>
|
<View style={{width: width}} className='p-2'>
|
||||||
<Image
|
<Image
|
||||||
source={{ uri: item }}
|
source={item}
|
||||||
className="h-auto w-full rounded-md aspect-square"
|
className="h-auto w-auto rounded-md aspect-[1/1]"
|
||||||
alt={`Zdjęcie ${index + 1}`}
|
alt={`Zdjęcie ${index + 1}`}
|
||||||
resizeMode="contain"
|
resizeMode="contain"
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user