From 509b26894cc3417f3266edf67780d476834cbaa3 Mon Sep 17 00:00:00 2001 From: Bagasbanuna02 Date: Fri, 7 Mar 2025 14:50:19 +0800 Subject: [PATCH] fix ui job --- src/app/api/job/route.ts | 2 +- src/app_modules/_global/ui/new_ui_content.tsx | 10 +++- .../_global/ui/new_ui_tamplate.tsx | 2 +- src/app_modules/home/v2_home_view.tsx | 2 +- src/app_modules/job/main/arsip/ui_arsip.tsx | 54 ------------------- src/app_modules/job/main/arsip/view_arsip.tsx | 10 ++-- .../job/main/beranda/view_beranda.tsx | 48 +++++++++-------- src/app_modules/job/main/new_layout.tsx | 15 +----- src/app_modules/job/main/status/ui_status.tsx | 1 - 9 files changed, 45 insertions(+), 99 deletions(-) delete mode 100644 src/app_modules/job/main/arsip/ui_arsip.tsx diff --git a/src/app/api/job/route.ts b/src/app/api/job/route.ts index ebb86e25..61b1acb6 100644 --- a/src/app/api/job/route.ts +++ b/src/app/api/job/route.ts @@ -10,7 +10,7 @@ export async function GET(request: Request) { const { searchParams } = new URL(request.url); const search = searchParams.get("search"); const page = searchParams.get("page"); - const dataTake = 5; + const dataTake = 10 const dataSkip = Number(page) * dataTake - dataTake; if (!page) { diff --git a/src/app_modules/_global/ui/new_ui_content.tsx b/src/app_modules/_global/ui/new_ui_content.tsx index ca290179..a886cab5 100644 --- a/src/app_modules/_global/ui/new_ui_content.tsx +++ b/src/app_modules/_global/ui/new_ui_content.tsx @@ -1,6 +1,12 @@ import { Box } from "@mantine/core"; -export function NewUI_Content({ children }: { children: React.ReactNode }) { +export function NewUI_Content({ + children, + isScroll, +}: { + children: React.ReactNode; + isScroll?: React.CSSProperties["overflowY"]; +}) { return ( <> - + diff --git a/src/app_modules/job/main/arsip/ui_arsip.tsx b/src/app_modules/job/main/arsip/ui_arsip.tsx deleted file mode 100644 index 1222d3b1..00000000 --- a/src/app_modules/job/main/arsip/ui_arsip.tsx +++ /dev/null @@ -1,54 +0,0 @@ -"use client"; - -import { RouterJob } from "@/lib/router_hipmi/router_job"; -import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data"; -import { Box, Center, Loader } from "@mantine/core"; -import _ from "lodash"; -import { ScrollOnly } from "next-scroll-loader"; -import { useState } from "react"; -import ComponentJob_CardStatus from "../../component/card/card_view"; -import { job_getAllArsipById } from "../../fun/get/get_all_arsip"; -import { MODEL_JOB } from "../../model/interface"; - -export function Job_UI_Arsip({ listData }: { listData: MODEL_JOB[] }) { - const [data, setData] = useState(listData); - const [activePage, setActivePage] = useState(1); - - return ( - <> - {_.isEmpty(data) ? ( - - ) : ( - // --- Main component --- // - - ( -
- -
- )} - data={data} - setData={setData} - moreData={async () => { - const loadData = await job_getAllArsipById({ - page: activePage + 1, - }); - - setActivePage((val) => val + 1); - - return loadData; - }} - > - {(item) => ( - - )} -
-
- )} - - ); -} diff --git a/src/app_modules/job/main/arsip/view_arsip.tsx b/src/app_modules/job/main/arsip/view_arsip.tsx index cede63f8..b7c47a7f 100644 --- a/src/app_modules/job/main/arsip/view_arsip.tsx +++ b/src/app_modules/job/main/arsip/view_arsip.tsx @@ -5,7 +5,7 @@ import ComponentGlobal_Loader from "@/app_modules/_global/component/loader"; import CustomSkeleton from "@/app_modules/components/CustomSkeleton"; import { RouterJob } from "@/lib/router_hipmi/router_job"; import { clientLogger } from "@/util/clientLogger"; -import { Box, Stack } from "@mantine/core"; +import { Box, Center, Stack } from "@mantine/core"; import { useShallowEffect } from "@mantine/hooks"; import _ from "lodash"; import { ScrollOnly } from "next-scroll-loader"; @@ -86,8 +86,12 @@ export default function Job_ViewArsip() { // --- Main component --- // } + height="80vh" + renderLoading={() => ( +
+ +
+ )} data={data} setData={setData} moreData={handleMoreData} diff --git a/src/app_modules/job/main/beranda/view_beranda.tsx b/src/app_modules/job/main/beranda/view_beranda.tsx index 184d2495..cff0ab5c 100644 --- a/src/app_modules/job/main/beranda/view_beranda.tsx +++ b/src/app_modules/job/main/beranda/view_beranda.tsx @@ -4,7 +4,7 @@ import { gs_jobTiggerBeranda } from "@/lib/global_state"; import { RouterJob } from "@/lib/router_hipmi/router_job"; import ComponentGlobal_CreateButton from "@/app_modules/_global/component/button_create"; import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data"; -import { Center, Loader, Stack, TextInput } from "@mantine/core"; +import { Box, Center, Loader, Stack, TextInput } from "@mantine/core"; import { useShallowEffect } from "@mantine/hooks"; import { IconSearch } from "@tabler/icons-react"; import { useAtom } from "jotai"; @@ -102,7 +102,7 @@ export default function Job_ViewBeranda() { return ( <> - + {isShowUpdate && ( { @@ -125,32 +125,34 @@ export default function Job_ViewBeranda() { }} radius={"xl"} icon={} - placeholder="Pekerjaan apa yang anda cari ?" + placeholder="Pekerjaan apa yang anda cari ni?" onChange={(val) => { onSearch(val.currentTarget.value); }} /> - {!data?.length && isLoading ? ( - - ) : _.isEmpty(data) ? ( - - ) : ( - // --- Main component --- // - ( -
- -
- )} - data={data} - setData={setData as any} - moreData={handleMoreData} - > - {(item) => } -
- )} + + {!data?.length && isLoading ? ( + + ) : _.isEmpty(data) ? ( + + ) : ( + // --- Main component --- // + ( +
+ +
+ )} + data={data} + setData={setData as any} + moreData={handleMoreData} + > + {(item) => } +
+ )} +
); diff --git a/src/app_modules/job/main/new_layout.tsx b/src/app_modules/job/main/new_layout.tsx index 28244456..98e51167 100644 --- a/src/app_modules/job/main/new_layout.tsx +++ b/src/app_modules/job/main/new_layout.tsx @@ -49,9 +49,9 @@ export default function NewLayoutJob_Main({ return ( <> - + - {children} + {children} @@ -82,17 +82,6 @@ export default function NewLayoutJob_Main({ - {/* - } - footer={} - > - {children} - */} ); } diff --git a/src/app_modules/job/main/status/ui_status.tsx b/src/app_modules/job/main/status/ui_status.tsx index 0f25e43a..4c6058f4 100644 --- a/src/app_modules/job/main/status/ui_status.tsx +++ b/src/app_modules/job/main/status/ui_status.tsx @@ -25,7 +25,6 @@ export default function Job_UiStatus() { return ( <>