Merge pull request #39 from bipproduction/join

Join
This commit is contained in:
Amalia
2024-01-22 10:56:01 +08:00
committed by GitHub
4 changed files with 16 additions and 14 deletions

View File

@@ -1,12 +1,18 @@
import { funGetUserProfile } from "@/app_modules/fun_global/get_user_profile";
import { EditProfileLayout } from "@/app_modules/katalog/profile";
export default async function Layout({ children, params }: { children: any, params: {id: string} }) {
const data = await funGetUserProfile(params.id)
const profileId = data?.Profile?.id
export default async function Layout({
children,
params,
}: {
children: any;
params: { id: string };
}) {
let profileId = params.id;
return (
<>
<EditProfileLayout profileId={profileId}>{children}</EditProfileLayout>
<EditProfileLayout>{children}</EditProfileLayout>
</>
);
}

View File

@@ -109,9 +109,9 @@ export default function HomeLayout({
}
}}
>
<Stack align="center" spacing={0}>
<Stack align="center" spacing={2}>
<ActionIcon variant={"transparent"}>
{user.Profile === null ? <IconUserCircle color="white" /> : <Avatar radius={"xl"} size={20} src={RouterProfile.api_foto_profile + `${user.Profile.imagesId}`}/>}
{user.Profile === null ? <IconUserCircle color="white" /> : <Avatar radius={"xl"} size={30} src={RouterProfile.api_foto_profile + `${user.Profile.imagesId}`}/>}
</ActionIcon>
<Text fz={"xs"} c={"white"}>
Profile

View File

@@ -41,7 +41,9 @@ export default function KatalogView({
profile={profile}
userLoginId={userLoginId}
/>
{profile.User.id === userLoginId ? <User_Logout /> : ""}
<Stack my={"lg"} w={"100%"}>
{profile.User.id === userLoginId ? <User_Logout /> : ""}
</Stack>
</Stack>
</>
);

View File

@@ -12,13 +12,7 @@ import { IconArrowLeft } from "@tabler/icons-react";
import { useRouter } from "next/navigation";
import ComponentKatalog_HeaderTamplate from "../../component/header_tamplate";
export default function EditProfileLayout({
children,
profileId,
}: {
children: any;
profileId: any;
}) {
export default function EditProfileLayout({ children }: { children: any }) {
const router = useRouter();
return (
<>