Fix: Db Profile

Deskripsi:
- Menghapus field imagesId dan imagesBackgroundId
- Menhapus table backgroundImage
- Menghapus component avatar dan header card yang lama
## No Issue
This commit is contained in:
2024-10-03 15:09:38 +08:00
parent ca99de7dd5
commit cf9355e91f
46 changed files with 81 additions and 1060 deletions

View File

@@ -1,100 +0,0 @@
"use client";
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
import {
Avatar,
Center,
Divider,
Grid,
Group,
Loader,
Overlay,
Stack,
Text,
} from "@mantine/core";
import { useRouter } from "next/navigation";
import { MODEL_USER } from "@/app_modules/home/model/interface";
import React, { useState } from "react";
import { ComponentGlobal_NotifikasiPeringatan } from "../notif_global/notifikasi_peringatan";
export default function ComponentGlobal_AvatarAndAuthorName({
dataUser,
isPembatas,
componentRight,
}: {
dataUser: MODEL_USER;
isPembatas?: boolean;
componentRight?: React.ReactNode;
}) {
const router = useRouter();
const [visible, setVisible] = useState(false);
return (
<>
<Stack spacing={"xs"}>
<Grid>
<Grid.Col
span={"content"}
onClick={() => {
if (dataUser?.Profile?.id) {
setVisible(true);
router.push(RouterProfile.katalogOLD + dataUser?.Profile?.id);
} else {
ComponentGlobal_NotifikasiPeringatan("Id tidak ditemukan");
}
}}
>
{visible ? (
<Avatar
size={30}
sx={{
borderStyle: "solid",
borderWidth: "1px",
borderColor: "white",
}}
radius={"xl"}
bg={"gray.1"}
>
<Overlay opacity={0.1}>
<Center h={"100%"}>
<Loader color="gray" size={20} />
</Center>
</Overlay>
</Avatar>
) : (
<Avatar
size={30}
sx={{
borderStyle: "solid",
borderWidth: "1px",
borderColor: "white",
}}
radius={"xl"}
bg={"gray.1"}
src={
dataUser?.Profile?.imagesId
? RouterProfile.api_foto_profile +
dataUser?.Profile?.imagesId
: "/aset/global/avatar.png"
}
/>
)}
</Grid.Col>
<Grid.Col span={"auto"}>
<Stack justify="center" h={"100%"} c={"white"}>
<Group position="apart">
<Stack justify="center" h={"100%"}>
<Text lineClamp={1} fz={"sm"} fw={"bold"}>
{dataUser?.username ? dataUser?.username : "Nama author"}
</Text>
</Stack>
{componentRight ? componentRight : null}
</Group>
</Stack>
</Grid.Col>
</Grid>
{isPembatas ? <Divider /> : ""}
</Stack>
</>
);
}

View File

@@ -1,6 +1,5 @@
import { ComponentGlobal_ButtonUploadFileImage } from "../button/comp_button_upload_photo";
import ComponentGlobal_BoxInformation from "./box_information";
import ComponentGlobal_AvatarAndAuthorName from "./comp_author_name_and_avatar";
import { ComponentGlobal_AvatarAndUsername } from "./comp_avatar_and_username";
import { ComponentGlobal_BoxUploadImage } from "./comp_box_upload_image";
import { ComponentGlobal_CardStyles } from "./comp_card_box_and_background";
@@ -16,7 +15,6 @@ import ComponentGlobal_InputCountDown from "./input_countdown";
export { ComponentGlobal_TampilanRupiah };
export { ComponentGlobal_TampilanAngkaRatusan };
export { ComponentGlobal_AvatarAndAuthorName };
export { ComponentGlobal_CardLoadingOverlay };
export { ComponentGlobal_BoxInformation };
export { ComponentGlobal_InputCountDown };