diff --git a/src/app/dev/vote/create/loading.tsx b/src/app/dev/vote/create/loading.tsx deleted file mode 100644 index 380b3fcd..00000000 --- a/src/app/dev/vote/create/loading.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2"; - -export default async function Page() { - return ( - <> - - - ); -} diff --git a/src/app/dev/vote/detail/draft/[id]/loading.tsx b/src/app/dev/vote/detail/draft/[id]/loading.tsx deleted file mode 100644 index 380b3fcd..00000000 --- a/src/app/dev/vote/detail/draft/[id]/loading.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2"; - -export default async function Page() { - return ( - <> - - - ); -} diff --git a/src/app/dev/vote/detail/main/[id]/loading.tsx b/src/app/dev/vote/detail/main/[id]/loading.tsx deleted file mode 100644 index 380b3fcd..00000000 --- a/src/app/dev/vote/detail/main/[id]/loading.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2"; - -export default async function Page() { - return ( - <> - - - ); -} diff --git a/src/app/dev/vote/detail/publish/[id]/loading.tsx b/src/app/dev/vote/detail/publish/[id]/loading.tsx deleted file mode 100644 index 380b3fcd..00000000 --- a/src/app/dev/vote/detail/publish/[id]/loading.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2"; - -export default async function Page() { - return ( - <> - - - ); -} diff --git a/src/app/dev/vote/detail/reject/[id]/loading.tsx b/src/app/dev/vote/detail/reject/[id]/loading.tsx deleted file mode 100644 index 380b3fcd..00000000 --- a/src/app/dev/vote/detail/reject/[id]/loading.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2"; - -export default async function Page() { - return ( - <> - - - ); -} diff --git a/src/app/dev/vote/detail/review/[id]/loading.tsx b/src/app/dev/vote/detail/review/[id]/loading.tsx deleted file mode 100644 index 380b3fcd..00000000 --- a/src/app/dev/vote/detail/review/[id]/loading.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2"; - -export default async function Page() { - return ( - <> - - - ); -} diff --git a/src/app/dev/vote/edit/[id]/loading.tsx b/src/app/dev/vote/edit/[id]/loading.tsx deleted file mode 100644 index 380b3fcd..00000000 --- a/src/app/dev/vote/edit/[id]/loading.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2"; - -export default async function Page() { - return ( - <> - - - ); -} diff --git a/src/app/dev/vote/main/beranda/page.tsx b/src/app/dev/vote/main/beranda/page.tsx index 25623b91..25ca9990 100644 --- a/src/app/dev/vote/main/beranda/page.tsx +++ b/src/app/dev/vote/main/beranda/page.tsx @@ -1,8 +1,8 @@ import { Vote_Beranda } from "@/app_modules/vote"; -import { Vote_getAllListPublish } from "@/app_modules/vote/fun/get/get_all_list_publish"; +import { vote_getAllListPublish } from "@/app_modules/vote/fun/get/get_all_list_publish"; export default async function Page() { - const dataVote = await Vote_getAllListPublish() + const dataVote = await vote_getAllListPublish({page: 1}) return ( <> diff --git a/src/app/dev/vote/main/loading.tsx b/src/app/dev/vote/main/loading.tsx deleted file mode 100644 index 380b3fcd..00000000 --- a/src/app/dev/vote/main/loading.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2"; - -export default async function Page() { - return ( - <> - - - ); -} diff --git a/src/app/dev/vote/main/status/page.tsx b/src/app/dev/vote/main/status/page.tsx index 8c612930..9946bbbe 100644 --- a/src/app/dev/vote/main/status/page.tsx +++ b/src/app/dev/vote/main/status/page.tsx @@ -1,12 +1,14 @@ import { Vote_Status } from "@/app_modules/vote"; -import { Vote_getListByStatusId } from "@/app_modules/vote/fun/get/get_list_status_by_status_id"; +import { vote_getAllDraft } from "@/app_modules/vote/fun/get/status/get_all_draft"; +import { vote_getAllPublish } from "@/app_modules/vote/fun/get/status/get_all_publish"; +import { vote_getAllReject } from "@/app_modules/vote/fun/get/status/get_all_reject"; +import { vote_getAllReview } from "@/app_modules/vote/fun/get/status/get_all_review"; export default async function Page() { - const listPublish = await Vote_getListByStatusId("1"); - const listReview = await Vote_getListByStatusId("2"); - const listDraft = await Vote_getListByStatusId("3"); - const listReject = await Vote_getListByStatusId("4"); - + const listPublish = await vote_getAllPublish({page: 1}); + const listReview = await vote_getAllReview({page: 1}); + const listDraft = await vote_getAllDraft({page: 1}); + const listReject = await vote_getAllReject({page: 1}); return ( <> diff --git a/src/app/dev/vote/splash/loading.tsx b/src/app/dev/vote/splash/loading.tsx deleted file mode 100644 index 380b3fcd..00000000 --- a/src/app/dev/vote/splash/loading.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2"; - -export default async function Page() { - return ( - <> - - - ); -} diff --git a/src/app_modules/_global/component/button_create.tsx b/src/app_modules/_global/component/button_create.tsx new file mode 100644 index 00000000..25e4b486 --- /dev/null +++ b/src/app_modules/_global/component/button_create.tsx @@ -0,0 +1,43 @@ +"use client"; + +import { RouterJob } from "@/app/lib/router_hipmi/router_job"; +import { AccentColor } from "@/app_modules/_global/color/color_pallet"; +import { ActionIcon, Loader } from "@mantine/core"; +import { IconPencilPlus } from "@tabler/icons-react"; +import { useRouter } from "next/navigation"; +import { useState } from "react"; + +export default function ComponentGlobal_CreateButton({ path }: { path: string }) { + const router = useRouter(); + const [isLoading, setLoading] = useState(false); + + return ( + <> + { + setLoading(true); + router.push(path); + }} + > + {isLoading ? ( + + ) : ( + + )} + + + ); +} diff --git a/src/app_modules/forum/main/layout.tsx b/src/app_modules/forum/main/layout.tsx index e072a3f8..7715dd2d 100644 --- a/src/app_modules/forum/main/layout.tsx +++ b/src/app_modules/forum/main/layout.tsx @@ -1,33 +1,17 @@ "use client"; +import { RouterForum } from "@/app/lib/router_hipmi/router_forum"; +import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog"; +import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate"; +import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate"; +import { MODEL_USER } from "@/app_modules/home/model/interface"; import { ActionIcon, - AppShell, Avatar, - Center, - Footer, - Grid, - Group, - Header, - Loader, - Stack, - Text, - Title, + Loader } from "@mantine/core"; -import React, { useState } from "react"; -import ComponentForum_HeaderTamplate from "../component/header/header_tamplate"; -import { RouterHome } from "@/app/lib/router_hipmi/router_home"; -import { RouterForum } from "@/app/lib/router_hipmi/router_forum"; -import { IconChevronLeft, IconCircle, IconHome } from "@tabler/icons-react"; -import router from "next/router"; import { useRouter } from "next/navigation"; -import { title } from "process"; -import { MODEL_USER } from "@/app_modules/home/model/interface"; -import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog"; -import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2"; -import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate"; -import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate"; -import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate"; +import React, { useState } from "react"; export default function LayoutForum_Main({ children, diff --git a/src/app_modules/job/detail/draft/layout.tsx b/src/app_modules/job/detail/draft/layout.tsx index caeb6c78..f1f4e02d 100644 --- a/src/app_modules/job/detail/draft/layout.tsx +++ b/src/app_modules/job/detail/draft/layout.tsx @@ -1,31 +1,15 @@ "use client"; -import { - ActionIcon, - AppShell, - Box, - Drawer, - Group, - Paper, - SimpleGrid, - Stack, - Text, - Title, -} from "@mantine/core"; -import React from "react"; -import ComponentJob_HeaderTamplate from "../../component/header_tamplate"; -import { IconDots, IconDotsVertical, IconEdit, IconX } from "@tabler/icons-react"; import { RouterJob } from "@/app/lib/router_hipmi/router_job"; -import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate"; -import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate"; -import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate"; -import { useRouter } from "next/navigation"; -import { useDisclosure } from "@mantine/hooks"; -import { - AccentColor, - MainColor, -} from "@/app_modules/_global/color/color_pallet"; import UIGlobal_Drawer from "@/app_modules/_global/ui/ui_drawer"; +import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate"; +import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate"; +import { + ActionIcon +} from "@mantine/core"; +import { useDisclosure } from "@mantine/hooks"; +import { IconDotsVertical, IconEdit } from "@tabler/icons-react"; +import React from "react"; export default function LayoutJob_DetailDraft({ children, @@ -34,7 +18,6 @@ export default function LayoutJob_DetailDraft({ children: React.ReactNode; jobId: string; }) { - const router = useRouter(); const [opened, { open, close }] = useDisclosure(); const listComponent = [ diff --git a/src/app_modules/job/main/arsip/ui_arsip.tsx b/src/app_modules/job/main/arsip/ui_arsip.tsx index 0284a39a..d1285ad6 100644 --- a/src/app_modules/job/main/arsip/ui_arsip.tsx +++ b/src/app_modules/job/main/arsip/ui_arsip.tsx @@ -1,55 +1,54 @@ -"use client" +"use client"; -import { useState } from "react" -import { MODEL_JOB } from "../../model/interface" -import _ from "lodash"; import { RouterJob } from "@/app/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_getAllStatusPublish from "../../fun/get/status/get_list_publish"; 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); +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, - }); + return ( + <> + {_.isEmpty(data) ? ( + + ) : ( + // --- Main component --- // + + ( +
+ +
+ )} + data={data} + setData={setData} + moreData={async () => { + const loadData = await job_getAllArsipById({ + page: activePage + 1, + }); - setActivePage((val) => val + 1); + setActivePage((val) => val + 1); - return loadData; - }} - > - {(item) => ( - - )} -
-
- )} - - ); -} \ No newline at end of file + return loadData; + }} + > + {(item) => ( + + )} +
+
+ )} + + ); +} diff --git a/src/app_modules/job/main/layout.tsx b/src/app_modules/job/main/layout.tsx index dcbf3602..bce57031 100644 --- a/src/app_modules/job/main/layout.tsx +++ b/src/app_modules/job/main/layout.tsx @@ -79,42 +79,6 @@ export default function LayoutJob_Main({ ))} - // - // - // {listFooter.map((e) => ( - // { - // // setLoading(true); - // // setTimeout(() => router.replace(e.path), 3000); - // router.replace(e.path); - // setHotMenuId(e.id); - // // setTimeout(() => setLoading(false), 1000); - // }} - // > - //
- // - // - // {e.icon} - // - // - // {e.name} - // - // - //
- //
- // ))} - //
- //
} > {children} diff --git a/src/app_modules/vote/component/card_view_publish.tsx b/src/app_modules/vote/component/card_view_publish.tsx index 357b8d65..622baae5 100644 --- a/src/app_modules/vote/component/card_view_publish.tsx +++ b/src/app_modules/vote/component/card_view_publish.tsx @@ -13,11 +13,15 @@ import { Text, Title, Box, + Center, + Progress, } from "@mantine/core"; import moment from "moment"; import { useRouter } from "next/navigation"; import { MODEL_VOTING } from "../model/interface"; import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan"; +import { AccentColor } from "@/app_modules/_global/color/color_pallet"; +import { toNumber } from "lodash"; export default function ComponentVote_CardViewPublish({ data, @@ -35,7 +39,19 @@ export default function ComponentVote_CardViewPublish({ const router = useRouter(); return ( <> - + {/* Header name */} {authorName ? ( @@ -48,6 +64,7 @@ export default function ComponentVote_CardViewPublish({ ) : ( "" )} + {/* Isi deskripsi */} - - {data ? data.title : "Judul Voting"} - - - - {data - ? data?.awalVote.toLocaleDateString(["id-ID"], { - dateStyle: "medium", - }) - : "tgl awal voting"} - - - - - {data - ? data?.akhirVote.toLocaleDateString(["id-ID"], { - dateStyle: "medium", - }) - : "tgl akhir voting"} - - - + + + + {data ? data.title : "Judul Voting"} + + + + + {data + ? data?.awalVote.toLocaleDateString(["id-ID"], { + dateStyle: "medium", + }) + : "tgl awal voting"} + + - + + {data + ? data?.akhirVote.toLocaleDateString(["id-ID"], { + dateStyle: "medium", + }) + : "tgl akhir voting"} + + + + {data ? ( - - {data?.Voting_DaftarNamaVote.map((v) => ( - - - - {v.value} - + {data?.Voting_DaftarNamaVote.map((v, i) => ( + + {v.value} + + + // + // + // + // {v.value} + // - - {v.jumlah} - - - - ))} - + // + // {v.jumlah} + // + // + // + ))} ) : ( diff --git a/src/app_modules/vote/component/card_view_status.tsx b/src/app_modules/vote/component/card_view_status.tsx index a30c5e73..311417a1 100644 --- a/src/app_modules/vote/component/card_view_status.tsx +++ b/src/app_modules/vote/component/card_view_status.tsx @@ -1,20 +1,10 @@ "use client"; -import { - Card, - Stack, - Title, - Badge, - Group, - Radio, - Grid, - Center, - Text, -} from "@mantine/core"; -import moment from "moment"; +import { AccentColor } from "@/app_modules/_global/color/color_pallet"; +import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan"; +import { Badge, Card, Group, Stack, Text } from "@mantine/core"; import { useRouter } from "next/navigation"; import { MODEL_VOTING } from "../model/interface"; -import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan"; export default function ComponentVote_CardViewStatus({ path, @@ -27,10 +17,14 @@ export default function ComponentVote_CardViewStatus({ return ( <> { if (data?.id === undefined) { ComponentGlobal_NotifikasiPeringatan("Path tidak ditemukan"); @@ -41,11 +35,21 @@ export default function ComponentVote_CardViewStatus({ > {/* Isi deskripsi */} - - + + {data?.title} - + {data?.awalVote.toLocaleDateString(["id-ID"], { diff --git a/src/app_modules/vote/component/detail/detail_daftar_kontributor.tsx b/src/app_modules/vote/component/detail/detail_daftar_kontributor.tsx index 989f1fbd..8cd44e18 100644 --- a/src/app_modules/vote/component/detail/detail_daftar_kontributor.tsx +++ b/src/app_modules/vote/component/detail/detail_daftar_kontributor.tsx @@ -1,23 +1,20 @@ "use client"; -import { - Card, - Stack, - Center, - Title, - Badge, - Group, - Radio, - Grid, - Text, - Avatar, - Divider, - Box, -} from "@mantine/core"; -import moment from "moment"; -import { MODEL_VOTE_KONTRIBUTOR } from "../../model/interface"; import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog"; +import { AccentColor } from "@/app_modules/_global/color/color_pallet"; +import { + Avatar, + Badge, + Card, + Center, + Divider, + Grid, + Stack, + Text, + Title +} from "@mantine/core"; import _ from "lodash"; import { useRouter } from "next/navigation"; +import { MODEL_VOTE_KONTRIBUTOR } from "../../model/interface"; export default function ComponentVote_DaftarKontributorVoter({ listKontributor, @@ -27,7 +24,15 @@ export default function ComponentVote_DaftarKontributorVoter({ const router = useRouter() return ( <> - +
@@ -36,15 +41,22 @@ export default function ComponentVote_DaftarKontributorVoter({ {_.isEmpty(listKontributor) ? (
- - Tidak ada voting - + + - Tidak ada voting - +
) : ( {listKontributor?.map((e, i) => ( - router.push(RouterProfile.katalog + e.Author.Profile.id)} + + router.push( + RouterProfile.katalog + e.Author.Profile.id + ) + } > - +
- {data?.title} + + {data?.title} +
{data?.deskripsi} - +
Batas Voting
- + {data?.awalVote.toLocaleDateString(["id-ID"], { diff --git a/src/app_modules/vote/component/detail/detail_data_setelah_publish.tsx b/src/app_modules/vote/component/detail/detail_data_setelah_publish.tsx index 0bb49b7a..949de897 100644 --- a/src/app_modules/vote/component/detail/detail_data_setelah_publish.tsx +++ b/src/app_modules/vote/component/detail/detail_data_setelah_publish.tsx @@ -15,6 +15,7 @@ import { MODEL_VOTING } from "../../model/interface"; import { IconCircle } from "@tabler/icons-react"; import _ from "lodash"; import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/_global/author_name_on_header"; +import { AccentColor } from "@/app_modules/_global/color/color_pallet"; export default function ComponentVote_DetailDataSetelahPublish({ data, @@ -25,7 +26,15 @@ export default function ComponentVote_DetailDataSetelahPublish({ }) { return ( <> - + {authorName ? (
- {data?.title} + + {data?.title} +
{data?.deskripsi} -
+ Batas Voting -
- - - - {data?.awalVote.toLocaleDateString(["id-ID"], { - dateStyle: "medium", - })} - - - - - {data?.akhirVote.toLocaleDateString(["id-ID"], { - dateStyle: "medium", - })} - - - + + + + {data?.awalVote.toLocaleDateString(["id-ID"], { + dateStyle: "medium", + })} + + - + + {data?.akhirVote.toLocaleDateString(["id-ID"], { + dateStyle: "medium", + })} + + + +
diff --git a/src/app_modules/vote/component/detail/detail_hasil_voting.tsx b/src/app_modules/vote/component/detail/detail_hasil_voting.tsx index 74b4113b..61a872b6 100644 --- a/src/app_modules/vote/component/detail/detail_hasil_voting.tsx +++ b/src/app_modules/vote/component/detail/detail_hasil_voting.tsx @@ -1,16 +1,14 @@ "use client"; +import { AccentColor } from "@/app_modules/_global/color/color_pallet"; import { Avatar, - Box, Card, Center, Grid, - Group, - List, Stack, Text, - Title, + Title } from "@mantine/core"; import { MODEL_VOTING_DAFTAR_NAMA_VOTE } from "../../model/interface"; @@ -21,7 +19,15 @@ export default function ComponentVote_HasilVoting({ }) { return ( <> - +
@@ -36,11 +42,13 @@ export default function ComponentVote_HasilVoting({ radius={100} size={70} variant="outline" - color="blue" + color="yellow" > - {e.jumlah} + {e.jumlah} - {e.value} + + {e.value} + ))} diff --git a/src/app_modules/vote/create/index.tsx b/src/app_modules/vote/create/index.tsx index 544b96ff..b2909bfd 100644 --- a/src/app_modules/vote/create/index.tsx +++ b/src/app_modules/vote/create/index.tsx @@ -13,7 +13,7 @@ import { Stack, Text, TextInput, - Textarea + Textarea, } from "@mantine/core"; import { DatePickerInput } from "@mantine/dates"; import { IconMinus, IconPlus } from "@tabler/icons-react"; @@ -26,6 +26,7 @@ import { useState } from "react"; import { Vote_funCreate } from "../fun/create/create_vote"; import { gs_vote_hotMenu, gs_vote_status } from "../global_state"; import { MODEL_VOTING } from "../model/interface"; +import { MainColor } from "@/app_modules/_global/color/color_pallet"; export default function Vote_Create() { const router = useRouter(); @@ -36,13 +37,10 @@ export default function Vote_Create() { const [data, setData] = useState({ title: "", deskripsi: "", - awalVote: Date, - akhirVote: Date, + awalVote: "", + akhirVote: "", }); - // const [range, setRange] = useState({ - // }); - const [listVote, setListVote] = useState([ { name: "Nama Pilihan", @@ -56,9 +54,14 @@ export default function Vote_Create() { return ( <> - +