fix (upload image)

deskripsi:
- upload image di portofolio
This commit is contained in:
2025-01-08 15:18:33 +08:00
parent a45e24efe4
commit 5dbecae360
17 changed files with 557 additions and 428 deletions

View File

@@ -18,10 +18,11 @@ import { Home_ComponentAvatarProfile } from "./comp_avatar_profile";
import { listMenuHomeFooter } from "./list_menu_home";
import { MainColor } from "@/app_modules/_global/color";
import { clientLogger } from "@/util/clientLogger";
import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
export default function FooterHome() {
const router = useRouter();
const [dataUser, setDataUser] = useState<any>({});
const [dataUser, setDataUser] = useState<any | null>(null);
useShallowEffect(() => {
cekUserLogin();
@@ -36,7 +37,7 @@ export default function FooterHome() {
setDataUser(response.data);
}
} catch (error) {
clientLogger.error("Error get data profile",error);
clientLogger.error("Error get data profile", error);
}
}
@@ -50,84 +51,101 @@ export default function FooterHome() {
bottom={0}
h={"9vh"}
>
<SimpleGrid cols={listMenuHomeFooter.length + 1}>
{listMenuHomeFooter.map((e) => (
<Center h={"9vh"} key={e.id}>
{dataUser?.profile === undefined || dataUser?.profile === null ? (
<SimpleGrid cols={4}>
{Array.from(new Array(4)).map((_, i) => (
<Center h={"9vh"} key={i}>
<Stack align="center">
<CustomSkeleton radius={"lg"} height={40} w={40} />
</Stack>
</Center>
))}
</SimpleGrid>
) : (
<SimpleGrid cols={listMenuHomeFooter.length + 1}>
{listMenuHomeFooter.map((e) => (
<Center h={"9vh"} key={e.id}>
<Stack
align="center"
spacing={0}
onClick={() => {
if (
dataUser.profile === undefined ||
dataUser?.profile === null
) {
return null;
} else if (
dataUser.profile === undefined ||
dataUser?.profile === null
) {
router.push(RouterProfile.create, { scroll: false });
} else {
if (e.link == "") {
ComponentGlobal_NotifikasiPeringatan("Cooming Soon");
} else {
router.push(e.link, { scroll: false });
}
}
}}
>
<ActionIcon
radius={"xl"}
c={e.link === "" ? "gray" : MainColor.white}
variant="transparent"
>
{e.icon}
</ActionIcon>
<Text
lineClamp={1}
c={e.link === "" ? "gray" : MainColor.white}
fz={12}
>
{e.name}
</Text>
</Stack>
</Center>
))}
<Center h={"9vh"}>
<Stack
align="center"
spacing={0}
spacing={2}
onClick={() => {
if (
dataUser.profile === undefined ||
dataUser?.profile === null
) {
return null;
} else if (
dataUser.profile === undefined ||
dataUser?.profile === null
) {
router.push(RouterProfile.create, { scroll: false });
} else {
if (e.link == "") {
ComponentGlobal_NotifikasiPeringatan("Cooming Soon");
} else {
router.push(e.link, { scroll: false });
}
router.push(
RouterProfile.katalogOLD + `${dataUser?.profile}`,
{
scroll: false,
}
);
}
}}
>
<ActionIcon
radius={"xl"}
c={e.link === "" ? "gray" : MainColor.white}
variant="transparent"
>
{e.icon}
<ActionIcon variant={"transparent"}>
{dataUser.profile === undefined ||
dataUser?.profile === null ? (
<IconUserCircle color={MainColor.white} />
) : (
<Home_ComponentAvatarProfile
url={APIs.GET({
fileId: dataUser?.imageId as string,
size: "50",
})}
/>
)}
</ActionIcon>
<Text lineClamp={1} c={e.link === "" ? "gray" : MainColor.white} fz={12}>
{e.name}
<Text fz={10} c={MainColor.white}>
Profile
</Text>
</Stack>
</Center>
))}
<Center h={"9vh"}>
<Stack
align="center"
spacing={2}
onClick={() => {
if (
dataUser.profile === undefined ||
dataUser?.profile === null
) {
router.push(RouterProfile.create, { scroll: false });
} else {
router.push(RouterProfile.katalogOLD + `${dataUser?.profile}`, {
scroll: false,
});
}
}}
>
<ActionIcon
variant={"transparent"}>
{dataUser.profile === undefined || dataUser?.profile === null ? (
<IconUserCircle color={MainColor.white} />
) : (
<Home_ComponentAvatarProfile
url={APIs.GET({
fileId: dataUser?.imageId as string,
size: "50",
})}
/>
)}
</ActionIcon>
<Text fz={10} c={MainColor.white}>
Profile
</Text>
</Stack>
</Center>
</SimpleGrid>
</SimpleGrid>
)}
</Box>
);
}