Add:
- Api background profile

Asset
Add:
- assets/images/loading.gif: untuk loading

### No Issue
This commit is contained in:
2025-08-27 14:38:37 +08:00
parent 2227aaa99f
commit 4fc2c90702
9 changed files with 134 additions and 45 deletions

View File

@@ -1,13 +1,33 @@
import { ViewWrapper } from "@/components";
import { CenterCustom, TextCustom, ViewWrapper } from "@/components";
import API_STRORAGE from "@/constants/base-url-api-strorage";
import { Image } from "expo-image";
import { useLocalSearchParams } from "expo-router";
import React, { useState } from "react";
export default function PreviewImage() {
const { id } = useLocalSearchParams();
const [isLoading, setIsLoading] = useState(true);
return (
<ViewWrapper>
<Image source={API_STRORAGE.GET({ fileId: id as string })} contentFit="contain" style={{ width: "100%", height: "100%" }}/>
{id ? (
<Image
onLoad={() => {
setIsLoading(false);
}}
source={
isLoading
? require("@/assets/images/loading.gif")
: API_STRORAGE.GET({ fileId: id as string })
}
contentFit="contain"
style={{ width: "100%", height: "100%" }}
/>
) : (
<CenterCustom>
<TextCustom>File not found</TextCustom>
</CenterCustom>
)}
</ViewWrapper>
);
}