fix layout forum

This commit is contained in:
2025-03-14 15:39:26 +08:00
parent cd294581f5
commit da6a9b0892
10 changed files with 149 additions and 64 deletions

View File

@@ -8,7 +8,6 @@ export default async function Layout({
children: React.ReactNode;
}) {
const userLoginId = await funGetUserIdByToken();
return (
<>

View File

@@ -134,7 +134,7 @@ export function UI_NewChildren({ children }: { children: ReactNode }) {
const { classes } = useStyles();
return (
<Box className={classes.content}>
<Container size="xl" pt={"md"}>
<Container size="xs" py={"xs"}>
{children}
</Container>
</Box>

View File

@@ -1,8 +1,11 @@
"use client";
import { Component_Header } from "@/app_modules/_global/component/new/component_header";
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
import UI_NewLayoutTamplate, {
UI_NewChildren,
UI_NewHeader,
} from "@/app_modules/_global/ui/V2_layout_tamplate";
import { useRouter } from "next/navigation";
import React, { useState } from "react";
@@ -19,13 +22,20 @@ export default function LayoutForum_Detail({
return (
<>
<UIGlobal_LayoutTamplate
{/* <UIGlobal_LayoutTamplate
header={
<UIGlobal_LayoutHeaderTamplate title="Postingan" posotion={"left"} />
}
>
{children}
</UIGlobal_LayoutTamplate>
</UIGlobal_LayoutTamplate> */}
<UI_NewLayoutTamplate>
<UI_NewHeader>
<Component_Header title="Postingan" posotion={"left"} />
</UI_NewHeader>
<UI_NewChildren>{children}</UI_NewChildren>
</UI_NewLayoutTamplate>
</>
);
}

View File

@@ -165,7 +165,7 @@ export default function Forum_MainDetail({
) : (
<Box>
<ScrollOnly
height={"60vh"}
height={"70vh"}
renderLoading={() => (
<Center mt={"lg"}>
<Loader color={"yellow"} />

View File

@@ -5,11 +5,7 @@ import { apiGetUserById } from "@/app_modules/_global/lib/api_user";
import { MODEL_USER } from "@/app_modules/home/model/interface";
import { RouterForum } from "@/lib/router_hipmi/router_forum";
import { clientLogger } from "@/util/clientLogger";
import {
Center,
Loader,
Stack
} from "@mantine/core";
import { Center, Loader, Stack } from "@mantine/core";
import { useShallowEffect } from "@mantine/hooks";
import _ from "lodash";
import { ScrollOnly } from "next-scroll-loader";
@@ -123,7 +119,7 @@ export default function Forum_Forumku({
) : (
// --- Main component --- //
<ScrollOnly
height={dataPosting.length < 5 ? "75vh" : "100vh"}
height={"75vh"}
renderLoading={() => (
<Center mt={"lg"}>
<Loader color={"yellow"} />

View File

@@ -1,7 +1,12 @@
"use client";
import { Component_Header } from "@/app_modules/_global/component/new/component_header";
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
import UI_NewLayoutTamplate, {
UI_NewHeader,
UI_NewChildren,
} from "@/app_modules/_global/ui/V2_layout_tamplate";
import { IconX } from "@tabler/icons-react";
import React from "react";
@@ -12,13 +17,20 @@ export default function LayoutForum_Forumku({
}) {
return (
<>
<UIGlobal_LayoutTamplate
{/* <UIGlobal_LayoutTamplate
header={
<UIGlobal_LayoutHeaderTamplate title={"Forum"} iconLeft={<IconX />} />
<UIGlobal_LayoutHeaderTamplate title="Forumku" iconLeft={<IconX />} />
}
>
{children}
</UIGlobal_LayoutTamplate>
</UIGlobal_LayoutTamplate> */}
<UI_NewLayoutTamplate>
<UI_NewHeader>
<Component_Header title={"Forum"} iconLeft={<IconX />} />
</UI_NewHeader>
<UI_NewChildren>{children}</UI_NewChildren>
</UI_NewLayoutTamplate>
</>
);
}

View File

@@ -3,7 +3,15 @@
import ComponentGlobal_CreateButton from "@/app_modules/_global/component/button_create";
import { RouterForum } from "@/lib/router_hipmi/router_forum";
import { clientLogger } from "@/util/clientLogger";
import { Affix, Center, Loader, Stack, TextInput, rem } from "@mantine/core";
import {
Affix,
Box,
Center,
Loader,
Stack,
TextInput,
rem,
} from "@mantine/core";
import { useShallowEffect } from "@mantine/hooks";
import _ from "lodash";
import { ScrollOnly } from "next-scroll-loader";
@@ -15,6 +23,7 @@ import { Forum_ComponentIsDataEmpty } from "../component/other_component";
import { Forum_SkeletonCard } from "../component/skeleton_view";
import { MODEL_FORUM_POSTING } from "../model/interface";
import mqtt_client from "@/util/mqtt_client";
import { AccentColor } from "@/app_modules/_global/color";
export default function Forum_Beranda({
userLoginId,
@@ -155,7 +164,7 @@ export default function Forum_Beranda({
<ComponentGlobal_CreateButton path={RouterForum.create} />
<Stack spacing={"xl"}>
<Stack>
<TextInput
disabled={!data}
radius={"xl"}
@@ -171,28 +180,31 @@ export default function Forum_Beranda({
<Forum_ComponentIsDataEmpty />
) : (
// --- Main component --- //
<ScrollOnly
height="85vh"
renderLoading={() => (
<Center mt={"lg"}>
<Loader color={"yellow"} />
</Center>
)}
data={data}
setData={setData as any}
moreData={handleMoreData}
<Box
>
{(item) => (
<ComponentForum_BerandaCardView
data={item}
userLoginId={userLoginId}
onLoadData={(val) => {
setData(val);
}}
allData={data}
/>
)}
</ScrollOnly>
<ScrollOnly
height="80vh"
renderLoading={() => (
<Center mt={"lg"}>
<Loader color={"yellow"} />
</Center>
)}
data={data}
setData={setData as any}
moreData={handleMoreData}
>
{(item) => (
<ComponentForum_BerandaCardView
data={item}
userLoginId={userLoginId}
onLoadData={(val) => {
setData(val);
}}
allData={data}
/>
)}
</ScrollOnly>
</Box>
)}
</Stack>
</>

View File

@@ -1,18 +1,21 @@
"use client";
import { RouterForum } from "@/lib/router_hipmi/router_forum";
import { ComponentGlobal_LoaderAvatar } from "@/app_modules/_global/component";
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
import { Component_Header } from "@/app_modules/_global/component/new/component_header";
import { apiGetUserById } from "@/app_modules/_global/lib/api_user";
import UI_NewLayoutTamplate, {
UI_NewChildren,
UI_NewHeader,
} from "@/app_modules/_global/ui/V2_layout_tamplate";
import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
import { MODEL_USER } from "@/app_modules/home/model/interface";
import { ActionIcon, Avatar } from "@mantine/core";
import { RouterForum } from "@/lib/router_hipmi/router_forum";
import { clientLogger } from "@/util/clientLogger";
import { ActionIcon, Avatar, TextInput } from "@mantine/core";
import { useShallowEffect } from "@mantine/hooks";
import { useRouter } from "next/navigation";
import React, { useState } from "react";
import { useShallowEffect } from "@mantine/hooks";
import { apiGetUserById } from "@/app_modules/_global/lib/api_user";
import { clientLogger } from "@/util/clientLogger";
import CustomSkeleton from "@/app_modules/components/CustomSkeleton";
export default function LayoutForum_Main({
userLoginId,
@@ -45,13 +48,56 @@ export default function LayoutForum_Main({
return (
<>
<UIGlobal_LayoutTamplate
<UI_NewLayoutTamplate>
<UI_NewHeader>
<Component_Header
title="Forum"
iconRight={
!data ? (
<CustomSkeleton height={30} width={30} circle />
) : (
<ActionIcon
radius={"xl"}
variant="transparent"
onClick={() => {
setIsLoading(true);
router.push(RouterForum.forumku + data?.id);
}}
>
{isLoading ? (
<Avatar
size={30}
radius={"100%"}
style={{
borderColor: "white",
borderStyle: "solid",
borderWidth: "1px",
}}
>
<ComponentGlobal_Loader variant="dots" />
</Avatar>
) : (
<ComponentGlobal_LoaderAvatar
fileId={data.Profile.imageId as any}
sizeAvatar={30}
/>
)}
</ActionIcon>
)
}
/>
</UI_NewHeader>
<UI_NewChildren>{children}</UI_NewChildren>
</UI_NewLayoutTamplate>
{/* <UIGlobal_LayoutTamplate
header={
<UIGlobal_LayoutHeaderTamplate
title="Forum"
iconRight={
!data ? (
<CustomSkeleton height={30} width={30} circle/>
<CustomSkeleton height={30} width={30} circle />
) : (
<ActionIcon
radius={"xl"}
@@ -86,7 +132,7 @@ export default function LayoutForum_Main({
}
>
{children}
</UIGlobal_LayoutTamplate>
</UIGlobal_LayoutTamplate> */}
</>
);
}

View File

@@ -1,7 +1,9 @@
"use client";
import { Component_Header } from "@/app_modules/_global/component/new/component_header";
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
import UI_NewLayoutTamplate, { UI_NewHeader, UI_NewChildren } from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutForum_ReportKomentar({
@@ -11,20 +13,20 @@ export default function LayoutForum_ReportKomentar({
}) {
return (
<>
<UIGlobal_LayoutTamplate
{/* <UIGlobal_LayoutTamplate
header={
<UIGlobal_LayoutHeaderTamplate title="Mengumpulkan Informasi Komentar" />
}
>
{children}
</UIGlobal_LayoutTamplate>
{/* <AppComponentGlobal_LayoutTamplate
header={
<ComponentForum_HeaderRataKiri title="Mengumpulkan Informasi Komentar"/>
}
>
{children}
</AppComponentGlobal_LayoutTamplate> */}
</UIGlobal_LayoutTamplate> */}
<UI_NewLayoutTamplate>
<UI_NewHeader>
<Component_Header title="Mengumpulkan Informasi Komentar" />
</UI_NewHeader>
<UI_NewChildren>{children}</UI_NewChildren>
</UI_NewLayoutTamplate>
</>
);
}

View File

@@ -1,7 +1,10 @@
"use client";
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
import { Component_Header } from "@/app_modules/_global/component/new/component_header";
import UI_NewLayoutTamplate, {
UI_NewChildren,
UI_NewHeader,
} from "@/app_modules/_global/ui/V2_layout_tamplate";
import React from "react";
export default function LayoutForum_ReportPosting({
@@ -11,15 +14,20 @@ export default function LayoutForum_ReportPosting({
}) {
return (
<>
<UIGlobal_LayoutTamplate
{/* <UIGlobal_LayoutTamplate
header={
<UIGlobal_LayoutHeaderTamplate title="Informasi Report Posting" />
}
>
{children}
</UIGlobal_LayoutTamplate>
</UIGlobal_LayoutTamplate> */}
<UI_NewLayoutTamplate>
<UI_NewHeader>
<Component_Header title="Informasi Report Posting" />
</UI_NewHeader>
<UI_NewChildren>{children}</UI_NewChildren>
</UI_NewLayoutTamplate>
</>
);
}