zdjęcia pobierają się na głównej stronie + naprawiono kilka innych bugów.

takich jak wyświetlanie "Moich ogłoszeń nie dla poprawnego id etc."
This commit is contained in:
2025-06-08 22:31:52 +02:00
parent bcce392c9b
commit 2218c5eb33
8 changed files with 172 additions and 164 deletions

View File

@@ -34,7 +34,7 @@ export function NoticeCard({ notice }) {
const fetchImage = async () => {
if (!noticeId) {
if (isMounted) {
setImage("https://http.cat/404.jpg");
setImage({uri: "https://http.cat/404.jpg"});
setIsLoading(false);
}
return;
@@ -45,13 +45,13 @@ export function NoticeCard({ notice }) {
const images = await getAllImagesByNoticeId(noticeId);
if (isMounted) {
setImage(
images && images.length > 0 ? images[0] : "https://http.cat/404.jpg"
images && images.length > 0 ? images[0] : {uri: "https://http.cat/404.jpg"}
);
}
} catch (error) {
console.error(`Error while loading image: ${error}`);
if (isMounted) {
setImage("https://http.cat/404.jpg");
setImage({uri: "https://http.cat/404.jpg"});
}
} finally {
if (isMounted) {
@@ -81,9 +81,7 @@ export function NoticeCard({ notice }) {
</Box>
) : (
<Image
source={{
uri: image,
}}
source={image}
className="h-auto w-full rounded-md aspect-[1/1]"
alt="image"
resizeMode="cover"