From 284787243bcec556399c3f84eab61bd01a4f76d4 Mon Sep 17 00:00:00 2001 From: Bagasbanuna02 Date: Tue, 1 Oct 2024 16:31:12 +0800 Subject: [PATCH] Fix: Avatar Deskripsi: - Avatar job - Avatar collaboration - Avatar event ## No Issuue --- package.json | 2 +- src/app/(not-user)/job-vacancy/[id]/page.tsx | 13 + .../(not-user)/preview-image/[id]/page.tsx | 10 + src/app/api/zz-makuro/route.ts | 7 + src/app/contoh/page.tsx | 110 -------- src/app/dev/auth/login/page.tsx | 5 +- .../dev/colab/detail/notifikasi/[id]/page.tsx | 13 - .../detail/status/publish/[id]/layout.tsx | 15 -- .../detail/status/publish/[id]/loading.tsx | 9 - .../colab/detail/status/publish/[id]/page.tsx | 9 - .../detail/status/reject/[id]/layout.tsx | 16 -- .../detail/status/reject/[id]/loading.tsx | 9 - .../colab/detail/status/reject/[id]/page.tsx | 9 - .../detail/status/review/[id]/layout.tsx | 16 -- .../detail/status/review/[id]/loading.tsx | 9 - .../colab/detail/status/review/[id]/page.tsx | 9 - src/app/dev/colab/main/notifikasi/page.tsx | 13 - src/app/dev/colab/main/status/loading.tsx | 9 - src/app/dev/colab/main/status/page.tsx | 19 -- src/app/dev/job/detail/main/[id]/page.tsx | 4 +- src/app/dev/job/non_user_view/[id]/page.tsx | 6 +- .../vote/detail/kontribusi/[id]/layout.tsx | 3 + src/app/dev/vote/detail/main/[id]/layout.tsx | 8 +- .../dev/vote/detail/publish/[id]/layout.tsx | 10 +- src/app/dev/vote/main/beranda/page.tsx | 14 +- src/app/emotion.tsx | 6 +- src/app/lib/index.ts | 2 + .../lib/router_hipmi/router_image_preview.ts | 3 +- src/app/lib/router_hipmi/router_job.ts | 1 + src/app/makuro/_server/makuro_test.ts | 4 - src/app/makuro/_server/makuro_view.tsx | 54 ---- src/app/makuro/_ui/RealtimePage.tsx | 37 --- src/app/makuro/_util.ts | 9 - src/app/makuro/gs_coba.ts | 3 - src/app/makuro/page.tsx | 14 - src/app/page.tsx | 2 - src/app/zz-makuro/page.tsx | 13 + .../component/comp_avatar_and_username.tsx | 16 +- .../comp_card_box_and_background.tsx | 4 +- .../_global/component/comp_load_image.tsx | 11 +- .../component/comp_not_user_load_image.tsx | 93 +++++++ src/app_modules/_global/component/index.ts | 2 + src/app_modules/_global/ui/index.ts | 4 + .../_global/ui/ui_layout_default.tsx | 45 ++++ .../_global/ui/ui_layout_tamplate.tsx | 5 +- .../_global/ui/ui_not_user_image_preview.tsx | 107 ++++++++ src/app_modules/auth/login/view.tsx | 43 ++-- src/app_modules/auth/register/view.tsx | 10 +- src/app_modules/auth/splash/view.tsx | 6 +- src/app_modules/auth/validasi/view.tsx | 9 +- .../component/card_view/card_beranda.tsx | 26 +- .../component/card_view/card_proyek_saya.tsx | 19 +- .../component/card_view/card_section_data.tsx | 5 + .../card_section_header_author_name.tsx | 147 ++++------- .../card_section_jumlah_partisipan.tsx | 9 +- .../card_view/card_semua_partisipan.tsx | 26 +- .../detail/header_author_list_partisipan.tsx | 31 ++- .../detail/list_partisipasi_user.tsx | 5 +- .../colab/component/header_author_name.tsx | 42 +-- .../colab/detail/info_grup/index.tsx | 76 +++--- .../colab/detail/main_detail/index.tsx | 50 ++-- .../colab/detail/notifikasi/index.tsx | 37 --- .../colab/detail/proyek/partisipasi/index.tsx | 43 ++-- .../colab/detail/proyek/saya/index.tsx | 36 +-- .../colab/detail/proyek/saya/layout.tsx | 13 +- .../colab/detail/status/publish/index.tsx | 164 ------------ .../colab/detail/status/publish/layout.tsx | 19 -- .../colab/detail/status/reject/index.tsx | 85 ------- .../colab/detail/status/reject/layout.tsx | 29 --- .../colab/detail/status/review/index.tsx | 39 --- .../colab/detail/status/review/layout.tsx | 21 -- .../room_chat/get_list_anggota_by_room_id.ts | 2 +- src/app_modules/colab/index.ts | 18 -- src/app_modules/colab/main/layout.tsx | 24 +- .../colab/main/pemberitahuan/index.tsx | 73 ------ src/app_modules/colab/main/proyek/saya.tsx | 13 +- src/app_modules/colab/main/status/index.tsx | 86 ------- src/app_modules/colab/main/status/publish.tsx | 41 --- src/app_modules/colab/main/status/reject.tsx | 31 --- src/app_modules/colab/main/status/review.tsx | 27 -- src/app_modules/job/_ui/index.ts | 3 + .../job/_ui/ui_not_user_view_job.tsx | 21 ++ src/app_modules/job/_view/index.ts | 3 + .../job/_view/view_not_user_view_job.tsx | 45 ++++ .../job/component/beranda/card_view.tsx | 74 ++---- .../detail/comp_detail_data_not_user.tsx | 61 +++++ .../job/component/detail/detail_data.tsx | 103 +++----- src/app_modules/job/detail/main/view.tsx | 40 +-- .../job/main/beranda/ui_beranda.tsx | 2 +- src/app_modules/job/non_user_view/layout.tsx | 9 +- src/app_modules/job/non_user_view/view.tsx | 74 +----- .../portofolio/ui/ui_detail_portofolio.tsx | 3 +- .../user_search/component/ui_user_search.tsx | 60 ++++- .../user_search/fun/get/get_all_user.ts | 9 +- .../_view/view_detail_kontributor_voting.tsx | 66 ++--- .../vote/component/card_view_publish.tsx | 239 +++++++++--------- .../comp_layout_header_detail_publish.tsx | 42 +-- .../detail/detail_daftar_kontributor.tsx | 109 +++----- .../detail/detail_data_setelah_publish.tsx | 54 ++-- .../vote/detail/kontribusi/index.tsx | 16 +- .../vote/detail/kontribusi/layout.tsx | 3 + src/app_modules/vote/detail/main/index.tsx | 39 +-- src/app_modules/vote/detail/main/layout.tsx | 3 + src/app_modules/vote/detail/publish/index.tsx | 3 +- .../vote/detail/publish/layout.tsx | 3 + .../vote/detail/riwayat_saya/index.tsx | 2 +- .../vote/detail/semua_riwayat/index.tsx | 2 +- .../get/get_list_kontribusi_by_author_id.ts | 2 +- .../fun/get/get_list_kontributor_by_id.ts | 3 + src/util/mqtt_loader.tsx | 6 +- 110 files changed, 1122 insertions(+), 2064 deletions(-) create mode 100644 src/app/(not-user)/job-vacancy/[id]/page.tsx create mode 100644 src/app/(not-user)/preview-image/[id]/page.tsx create mode 100644 src/app/api/zz-makuro/route.ts delete mode 100644 src/app/contoh/page.tsx delete mode 100644 src/app/dev/colab/detail/notifikasi/[id]/page.tsx delete mode 100644 src/app/dev/colab/detail/status/publish/[id]/layout.tsx delete mode 100644 src/app/dev/colab/detail/status/publish/[id]/loading.tsx delete mode 100644 src/app/dev/colab/detail/status/publish/[id]/page.tsx delete mode 100644 src/app/dev/colab/detail/status/reject/[id]/layout.tsx delete mode 100644 src/app/dev/colab/detail/status/reject/[id]/loading.tsx delete mode 100644 src/app/dev/colab/detail/status/reject/[id]/page.tsx delete mode 100644 src/app/dev/colab/detail/status/review/[id]/layout.tsx delete mode 100644 src/app/dev/colab/detail/status/review/[id]/loading.tsx delete mode 100644 src/app/dev/colab/detail/status/review/[id]/page.tsx delete mode 100644 src/app/dev/colab/main/notifikasi/page.tsx delete mode 100644 src/app/dev/colab/main/status/loading.tsx delete mode 100644 src/app/dev/colab/main/status/page.tsx delete mode 100644 src/app/makuro/_server/makuro_test.ts delete mode 100644 src/app/makuro/_server/makuro_view.tsx delete mode 100644 src/app/makuro/_ui/RealtimePage.tsx delete mode 100644 src/app/makuro/_util.ts delete mode 100644 src/app/makuro/gs_coba.ts delete mode 100644 src/app/makuro/page.tsx create mode 100644 src/app/zz-makuro/page.tsx create mode 100644 src/app_modules/_global/component/comp_not_user_load_image.tsx create mode 100644 src/app_modules/_global/ui/ui_layout_default.tsx create mode 100644 src/app_modules/_global/ui/ui_not_user_image_preview.tsx delete mode 100644 src/app_modules/colab/detail/notifikasi/index.tsx delete mode 100644 src/app_modules/colab/detail/status/publish/index.tsx delete mode 100644 src/app_modules/colab/detail/status/publish/layout.tsx delete mode 100644 src/app_modules/colab/detail/status/reject/index.tsx delete mode 100644 src/app_modules/colab/detail/status/reject/layout.tsx delete mode 100644 src/app_modules/colab/detail/status/review/index.tsx delete mode 100644 src/app_modules/colab/detail/status/review/layout.tsx delete mode 100644 src/app_modules/colab/main/pemberitahuan/index.tsx delete mode 100644 src/app_modules/colab/main/status/index.tsx delete mode 100644 src/app_modules/colab/main/status/publish.tsx delete mode 100644 src/app_modules/colab/main/status/reject.tsx delete mode 100644 src/app_modules/colab/main/status/review.tsx create mode 100644 src/app_modules/job/_ui/index.ts create mode 100644 src/app_modules/job/_ui/ui_not_user_view_job.tsx create mode 100644 src/app_modules/job/_view/index.ts create mode 100644 src/app_modules/job/_view/view_not_user_view_job.tsx create mode 100644 src/app_modules/job/component/detail/comp_detail_data_not_user.tsx diff --git a/package.json b/package.json index fcb866a7..cc991669 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hipmi", - "version": "0.1.0", + "version": "1.0.0", "private": true, "prisma": { "seed": "npx tsx prisma/seed.ts" diff --git a/src/app/(not-user)/job-vacancy/[id]/page.tsx b/src/app/(not-user)/job-vacancy/[id]/page.tsx new file mode 100644 index 00000000..33425748 --- /dev/null +++ b/src/app/(not-user)/job-vacancy/[id]/page.tsx @@ -0,0 +1,13 @@ +import { Job_UiNotUserView } from "@/app_modules/job/_ui"; +import { job_getOneById } from "@/app_modules/job/fun/get/get_one_by_id"; + +export default async function Page({ params }: { params: { id: string } }) { + const jobId = params.id; + const dataJob = await job_getOneById(jobId); + + return ( + <> + + + ); +} diff --git a/src/app/(not-user)/preview-image/[id]/page.tsx b/src/app/(not-user)/preview-image/[id]/page.tsx new file mode 100644 index 00000000..72eebf8c --- /dev/null +++ b/src/app/(not-user)/preview-image/[id]/page.tsx @@ -0,0 +1,10 @@ +import { UIGlobal_ImagePreview, UIGlobal_NotUserImagePreview } from "@/app_modules/_global/ui"; + +export default async function Page({ params }: { params: { id: string } }) { + const fileId = params.id; + return ( + <> + + + ); +} diff --git a/src/app/api/zz-makuro/route.ts b/src/app/api/zz-makuro/route.ts new file mode 100644 index 00000000..df7b0d72 --- /dev/null +++ b/src/app/api/zz-makuro/route.ts @@ -0,0 +1,7 @@ +import { headers } from "next/headers"; +export async function GET( + req: Request) { + const origin = new URL(req.url).origin; + + return new Response(JSON.stringify({ success: true, origin })); +} diff --git a/src/app/contoh/page.tsx b/src/app/contoh/page.tsx deleted file mode 100644 index 60e2265b..00000000 --- a/src/app/contoh/page.tsx +++ /dev/null @@ -1,110 +0,0 @@ -"use client"; - -import { - ComponentGlobal_AvatarAndUsername, - ComponentGlobal_LoaderAvatar, -} from "@/app_modules/_global/component"; -import ComponentGlobal_Loader from "@/app_modules/_global/component/loader"; -import { - UIGlobal_LayoutHeaderTamplate, - UIGlobal_LayoutTamplate, -} from "@/app_modules/_global/ui"; -import { - ActionIcon, - Avatar, - Box, - Center, - Group, - Image, - Paper, - Text, -} from "@mantine/core"; -import { useShallowEffect } from "@mantine/hooks"; -import { IconDots } from "@tabler/icons-react"; -import { useState } from "react"; - -export default function Page() { - return ( - <> - } - > - - - {Intl.DateTimeFormat("id-ID", {dateStyle: "full"}).format(new Date())} - - } - /> - - - - ); - - return ( - <> - -
- - - -
-
- - ); - return ( - <> - - - ); -} - -function LoadImage({ url }: { url: string }) { - const [ada, setAda] = useState(null); - - useShallowEffect(() => { - load(); - }, []); - - async function load() { - try { - const res = await fetch(url); - if (res.ok) { - return setAda(true); - } - setAda(false); - } catch (error) { - console.log(""); - } - } - - if (ada === null) - return ( - - - - ); - if (!ada) - return ( - - ); - return ; -} diff --git a/src/app/dev/auth/login/page.tsx b/src/app/dev/auth/login/page.tsx index 30fe153d..aad1ce63 100644 --- a/src/app/dev/auth/login/page.tsx +++ b/src/app/dev/auth/login/page.tsx @@ -1,9 +1,12 @@ import { Login } from "@/app_modules/auth"; +import versionUpdate from "../../../../../package.json"; export default async function Page() { + const version = versionUpdate.version; + return ( <> - + ); } diff --git a/src/app/dev/colab/detail/notifikasi/[id]/page.tsx b/src/app/dev/colab/detail/notifikasi/[id]/page.tsx deleted file mode 100644 index 26b781da..00000000 --- a/src/app/dev/colab/detail/notifikasi/[id]/page.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { Colab_DetailNotifikasi } from "@/app_modules/colab"; -import colab_getOneNotifikasiById from "@/app_modules/colab/fun/get/get_one_notifikasi_by_id"; - -export default async function Page({ params }: { params: { id: string } }) { - let notifId = params.id; - const data = await colab_getOneNotifikasiById({ notifId: notifId }); - - return ( - <> - - - ); -} diff --git a/src/app/dev/colab/detail/status/publish/[id]/layout.tsx b/src/app/dev/colab/detail/status/publish/[id]/layout.tsx deleted file mode 100644 index 87398d2d..00000000 --- a/src/app/dev/colab/detail/status/publish/[id]/layout.tsx +++ /dev/null @@ -1,15 +0,0 @@ - -import { LayoutColab_DetailStatusPublish } from "@/app_modules/colab"; -import React from "react"; - -export default async function Layout({ - children, -}: { - children: React.ReactNode; -}) { - return ( - <> - {children} - - ); -} diff --git a/src/app/dev/colab/detail/status/publish/[id]/loading.tsx b/src/app/dev/colab/detail/status/publish/[id]/loading.tsx deleted file mode 100644 index 380b3fcd..00000000 --- a/src/app/dev/colab/detail/status/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/colab/detail/status/publish/[id]/page.tsx b/src/app/dev/colab/detail/status/publish/[id]/page.tsx deleted file mode 100644 index 96e91ea3..00000000 --- a/src/app/dev/colab/detail/status/publish/[id]/page.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import { Colab_DetailStatusPublish } from "@/app_modules/colab"; - -export default async function Page() { - return ( - <> - - - ); -} diff --git a/src/app/dev/colab/detail/status/reject/[id]/layout.tsx b/src/app/dev/colab/detail/status/reject/[id]/layout.tsx deleted file mode 100644 index 778d5d48..00000000 --- a/src/app/dev/colab/detail/status/reject/[id]/layout.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { LayoutColab_DetailStatusReject } from "@/app_modules/colab"; -import React from "react"; - -export default async function Layout({ - children, -}: { - children: React.ReactNode; -}) { - return ( - <> - - {children} - - - ); -} diff --git a/src/app/dev/colab/detail/status/reject/[id]/loading.tsx b/src/app/dev/colab/detail/status/reject/[id]/loading.tsx deleted file mode 100644 index 380b3fcd..00000000 --- a/src/app/dev/colab/detail/status/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/colab/detail/status/reject/[id]/page.tsx b/src/app/dev/colab/detail/status/reject/[id]/page.tsx deleted file mode 100644 index 0962f23f..00000000 --- a/src/app/dev/colab/detail/status/reject/[id]/page.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import { Colab_DetailStatusReject } from "@/app_modules/colab"; - -export default async function Page() { - return ( - <> - - - ); -} diff --git a/src/app/dev/colab/detail/status/review/[id]/layout.tsx b/src/app/dev/colab/detail/status/review/[id]/layout.tsx deleted file mode 100644 index c2972b6a..00000000 --- a/src/app/dev/colab/detail/status/review/[id]/layout.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { LayoutColab_DetailStatusReview } from "@/app_modules/colab"; -import React from "react"; - -export default async function Layout({ - children, -}: { - children: React.ReactNode; -}) { - return ( - <> - - {children} - - - ); -} diff --git a/src/app/dev/colab/detail/status/review/[id]/loading.tsx b/src/app/dev/colab/detail/status/review/[id]/loading.tsx deleted file mode 100644 index 380b3fcd..00000000 --- a/src/app/dev/colab/detail/status/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/colab/detail/status/review/[id]/page.tsx b/src/app/dev/colab/detail/status/review/[id]/page.tsx deleted file mode 100644 index f6b5ea3f..00000000 --- a/src/app/dev/colab/detail/status/review/[id]/page.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import { Colab_DetailStatusReview } from "@/app_modules/colab"; - -export default async function Page() { - return ( - <> - - - ); -} diff --git a/src/app/dev/colab/main/notifikasi/page.tsx b/src/app/dev/colab/main/notifikasi/page.tsx deleted file mode 100644 index 4343e1ca..00000000 --- a/src/app/dev/colab/main/notifikasi/page.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { Colab_NotifikasiView } from "@/app_modules/colab"; -import colab_getListNotifikasiByUserId from "@/app_modules/colab/fun/get/get_list_notifikasi_by_user_id"; - -export default async function Page() { - const listNotifikasi = await colab_getListNotifikasiByUserId(); - // console.log(listNotifikasi); - - return ( - <> - - - ); -} diff --git a/src/app/dev/colab/main/status/loading.tsx b/src/app/dev/colab/main/status/loading.tsx deleted file mode 100644 index 380b3fcd..00000000 --- a/src/app/dev/colab/main/status/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/colab/main/status/page.tsx b/src/app/dev/colab/main/status/page.tsx deleted file mode 100644 index 4b703e5d..00000000 --- a/src/app/dev/colab/main/status/page.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { Colab_Status } from "@/app_modules/colab"; -import colab_getListByStatusId from "@/app_modules/colab/fun/get/get_list_by_status_id"; - -export default async function Page() { - const listPublish = (await colab_getListByStatusId(1)).data; - const listReview = (await colab_getListByStatusId(2)).data; - const listReject = (await colab_getListByStatusId(3)).data; - - - return ( - <> - - - ); -} diff --git a/src/app/dev/job/detail/main/[id]/page.tsx b/src/app/dev/job/detail/main/[id]/page.tsx index bfe9b192..2928fe5d 100644 --- a/src/app/dev/job/detail/main/[id]/page.tsx +++ b/src/app/dev/job/detail/main/[id]/page.tsx @@ -1,7 +1,5 @@ -"use server"; import { Job_MainDetail } from "@/app_modules/job"; import { job_getOneById } from "@/app_modules/job/fun/get/get_one_by_id"; -import app_config from "@/util/app_config"; export default async function Page({ params }: { params: { id: string } }) { const idJob = params.id; @@ -9,7 +7,7 @@ export default async function Page({ params }: { params: { id: string } }) { return ( <> - + ); } diff --git a/src/app/dev/job/non_user_view/[id]/page.tsx b/src/app/dev/job/non_user_view/[id]/page.tsx index f69c2288..f9e05e4e 100644 --- a/src/app/dev/job/non_user_view/[id]/page.tsx +++ b/src/app/dev/job/non_user_view/[id]/page.tsx @@ -4,11 +4,7 @@ import { job_getOneById } from "@/app_modules/job/fun/get/get_one_by_id"; export default async function Page({ params }: { params: { id: string } }) { let jobId = params.id; const dataJob = await job_getOneById(jobId); - // const platform = os.platform(); - // const hostName = - // platform === "darwin" - // ? "http://localhost:3000" - // : "https://test-hipmi.wibudev.com"; + return ( <> diff --git a/src/app/dev/vote/detail/kontribusi/[id]/layout.tsx b/src/app/dev/vote/detail/kontribusi/[id]/layout.tsx index e591dd90..3f15bfa7 100644 --- a/src/app/dev/vote/detail/kontribusi/[id]/layout.tsx +++ b/src/app/dev/vote/detail/kontribusi/[id]/layout.tsx @@ -1,5 +1,6 @@ import { funGetUserIdByToken } from "@/app_modules/_global/fun/get"; import { LayoutVote_DetailKontribusi } from "@/app_modules/vote"; +import { voting_funGetOneVotingbyId } from "@/app_modules/vote/fun/get/fun_get_one_by_id"; import React from "react"; export default async function Layout({ @@ -11,12 +12,14 @@ export default async function Layout({ }) { const votingId = params.id; const userLoginId = await funGetUserIdByToken(); + const dataVoting = await voting_funGetOneVotingbyId(votingId); return ( <> {children} diff --git a/src/app/dev/vote/detail/main/[id]/layout.tsx b/src/app/dev/vote/detail/main/[id]/layout.tsx index 7a3d7e0d..121cc566 100644 --- a/src/app/dev/vote/detail/main/[id]/layout.tsx +++ b/src/app/dev/vote/detail/main/[id]/layout.tsx @@ -1,5 +1,6 @@ import { funGetUserIdByToken } from "@/app_modules/_global/fun/get"; import { LayoutVote_MainDetail } from "@/app_modules/vote"; +import { voting_funGetOneVotingbyId } from "@/app_modules/vote/fun/get/fun_get_one_by_id"; import React from "react"; export default async function Layout({ @@ -11,10 +12,15 @@ export default async function Layout({ }) { const votingId = params.id; const userLoginId = await funGetUserIdByToken(); + const dataVoting = await voting_funGetOneVotingbyId(votingId); return ( <> - + {children} diff --git a/src/app/dev/vote/detail/publish/[id]/layout.tsx b/src/app/dev/vote/detail/publish/[id]/layout.tsx index 4047d0b1..416a36a8 100644 --- a/src/app/dev/vote/detail/publish/[id]/layout.tsx +++ b/src/app/dev/vote/detail/publish/[id]/layout.tsx @@ -1,6 +1,6 @@ import { funGetUserIdByToken } from "@/app_modules/_global/fun/get"; import { LayoutVote_DetailPublish } from "@/app_modules/vote"; -import { Voting_funGetOneVotingbyId } from "@/app_modules/vote/fun/get"; +import { voting_funGetOneVotingbyId } from "@/app_modules/vote/fun/get/fun_get_one_by_id"; import React from "react"; export default async function Layout({ @@ -13,11 +13,15 @@ export default async function Layout({ const votingId = params.id; const userLoginId = await funGetUserIdByToken(); - const dataVoting = await Voting_funGetOneVotingbyId(votingId); + const dataVoting = await voting_funGetOneVotingbyId(votingId); return ( <> - + {children} diff --git a/src/app/dev/vote/main/beranda/page.tsx b/src/app/dev/vote/main/beranda/page.tsx index 25ca9990..28904aca 100644 --- a/src/app/dev/vote/main/beranda/page.tsx +++ b/src/app/dev/vote/main/beranda/page.tsx @@ -2,11 +2,11 @@ import { Vote_Beranda } from "@/app_modules/vote"; import { vote_getAllListPublish } from "@/app_modules/vote/fun/get/get_all_list_publish"; export default async function Page() { - const dataVote = await vote_getAllListPublish({page: 1}) + const dataVote = await vote_getAllListPublish({ page: 1 }); - return ( - <> - - - ); -} \ No newline at end of file + return ( + <> + + + ); +} diff --git a/src/app/emotion.tsx b/src/app/emotion.tsx index da5c3f5f..303639ae 100644 --- a/src/app/emotion.tsx +++ b/src/app/emotion.tsx @@ -1,13 +1,9 @@ "use client"; -import { MainColor } from "@/app_modules/_global/color/color_pallet"; // import './globals.css' import { CacheProvider } from "@emotion/react"; import { - Box, - Container, MantineProvider, - rem, - useEmotionCache, + useEmotionCache } from "@mantine/core"; import { Notifications } from "@mantine/notifications"; import { Provider } from "jotai"; diff --git a/src/app/lib/index.ts b/src/app/lib/index.ts index cf5e4ff2..7840c0e3 100644 --- a/src/app/lib/index.ts +++ b/src/app/lib/index.ts @@ -3,7 +3,9 @@ import DIRECTORY_ID from "./id-derectory"; import prisma from "./prisma"; import { pathAssetImage } from "./path_asset_image"; + export { DIRECTORY_ID }; export { prisma }; export { APIs }; export { pathAssetImage as RouterAssetImage }; + diff --git a/src/app/lib/router_hipmi/router_image_preview.ts b/src/app/lib/router_hipmi/router_image_preview.ts index 84e18da4..e16cec15 100644 --- a/src/app/lib/router_hipmi/router_image_preview.ts +++ b/src/app/lib/router_hipmi/router_image_preview.ts @@ -1,3 +1,4 @@ export const routerImagePreview = { - "main": ({ id }: { id: string }) => `/dev/image-preview/${id}`, + main: ({ id }: { id: string }) => `/dev/image-preview/${id}`, + not_user_image: ({ id }: { id: string }) => `/preview-image/${id}`, }; diff --git a/src/app/lib/router_hipmi/router_job.ts b/src/app/lib/router_hipmi/router_job.ts index 9cbc9baf..3251efec 100644 --- a/src/app/lib/router_hipmi/router_job.ts +++ b/src/app/lib/router_hipmi/router_job.ts @@ -24,4 +24,5 @@ export const RouterJob = { // non user non_user_view: "/dev/job/non_user_view/", + "job_vacancy_non_user": ({ id }: { id: string }) => `/job-vacancy/${id}`, }; diff --git a/src/app/makuro/_server/makuro_test.ts b/src/app/makuro/_server/makuro_test.ts deleted file mode 100644 index 4f5b3010..00000000 --- a/src/app/makuro/_server/makuro_test.ts +++ /dev/null @@ -1,4 +0,0 @@ -'use server' -export default async function makuro_test() { - console.log("ini diserver") -} \ No newline at end of file diff --git a/src/app/makuro/_server/makuro_view.tsx b/src/app/makuro/_server/makuro_view.tsx deleted file mode 100644 index 4ff96721..00000000 --- a/src/app/makuro/_server/makuro_view.tsx +++ /dev/null @@ -1,54 +0,0 @@ -"use client"; - -import { Box, Button, Stack, TextInput } from "@mantine/core"; -import makuro_test from "./makuro_test"; -import { useState } from "react"; -import _, { forIn } from "lodash"; - -export default function ViewMakuro() { - const [listnya, setListnya] = useState([ - { - name: "Voting", - value: "", - }, - { name: "Voting", value: "" }, - ]); - - return ( - <> - - {listnya.map((e, k) => ( - - { - const val = _.clone(listnya); - val[k].value = v.currentTarget.value; - setListnya([...val]); - }} - label={e.name} - /> - - ))} - - - - - ); -} diff --git a/src/app/makuro/_ui/RealtimePage.tsx b/src/app/makuro/_ui/RealtimePage.tsx deleted file mode 100644 index bafc45cc..00000000 --- a/src/app/makuro/_ui/RealtimePage.tsx +++ /dev/null @@ -1,37 +0,0 @@ -"use client"; -import { Button, Group, Stack } from "@mantine/core"; -import { useShallowEffect } from "@mantine/hooks"; -import { useWibuRealtime } from "wibu-realtime"; - -export function RealtimePage({ token }: { token: string }) { - const [data, setData] = useWibuRealtime({ - project: "hipmi", - WIBU_REALTIME_TOKEN: token, - }); - - useShallowEffect(() => { - if (data) { - console.log(data); - } - }, [data]); - - function onKirim() { - setData({ - id: "123", - data: { - "topic":"test", - } - - }); - } - return ( - - - - {JSON.stringify(data)} - - - - - ); -} diff --git a/src/app/makuro/_util.ts b/src/app/makuro/_util.ts deleted file mode 100644 index ac32e21f..00000000 --- a/src/app/makuro/_util.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { v4 as uuidv4 } from "uuid"; - -export const createItems = (length = 100): string[] => - Array.from({ length }).map(() => uuidv4()); - -export const loadMore = async (length = 100): Promise => { - console.log("Loading more items..."); - return new Promise((res) => setTimeout(() => res(createItems(length)), 100)); -}; diff --git a/src/app/makuro/gs_coba.ts b/src/app/makuro/gs_coba.ts deleted file mode 100644 index b63754c4..00000000 --- a/src/app/makuro/gs_coba.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { atomWithStorage } from "jotai/utils"; - -export const gs_coba_chat = atomWithStorage("gs_coba_chat", []); \ No newline at end of file diff --git a/src/app/makuro/page.tsx b/src/app/makuro/page.tsx deleted file mode 100644 index 116871bd..00000000 --- a/src/app/makuro/page.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import { ServerEnv } from "../lib/server_env"; -import { RealtimePage } from "./_ui/RealtimePage"; -const env = process.env; -const WIBU_REALTIME_KEY = process.env.WIBU_REALTIME_KEY; - -export default function App() { - return ( -
- {/*
{JSON.stringify(env, null, 2)}
-
{JSON.stringify(ServerEnv.value, null, 2)}
*/} - -
- ); -} diff --git a/src/app/page.tsx b/src/app/page.tsx index 76e0c4f4..4f39ec07 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,5 +1,3 @@ -import { SplashScreen } from "@/app_modules/auth"; -import { redirect } from "next/navigation"; import PageSplash from "./dev/auth/splash/page"; export default async function Page() { diff --git a/src/app/zz-makuro/page.tsx b/src/app/zz-makuro/page.tsx new file mode 100644 index 00000000..a984807d --- /dev/null +++ b/src/app/zz-makuro/page.tsx @@ -0,0 +1,13 @@ +"use client"; +import { useShallowEffect } from "@mantine/hooks"; +import { useState } from "react"; + +export default function Page() { + const [origin, setOrigin] = useState(""); + useShallowEffect(() => { + if (typeof window !== "undefined") { + setOrigin(window.location.origin); + } + }, []); + return
{origin}
; +} diff --git a/src/app_modules/_global/component/comp_avatar_and_username.tsx b/src/app_modules/_global/component/comp_avatar_and_username.tsx index 08a07eb5..9269be4a 100644 --- a/src/app_modules/_global/component/comp_avatar_and_username.tsx +++ b/src/app_modules/_global/component/comp_avatar_and_username.tsx @@ -10,17 +10,17 @@ import { funGlobal_CheckProfile } from "../fun/get"; import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog"; import { ComponentGlobal_NotifikasiPeringatan } from "../notif_global"; -type IFontSize = "xs" | "sm" | "md" | "lg" | "xl" +type IFontSize = "xs" | "sm" | "md" | "lg" | "xl"; export function ComponentGlobal_AvatarAndUsername({ profile, component, sizeAvatar, - fontSize + fontSize, }: { profile: Prisma.ProfileSelect; component?: React.ReactNode; sizeAvatar?: number; - fontSize?: IFontSize | {} + fontSize?: IFontSize | {}; }) { const router = useRouter(); const [visible, setVisible] = useState(false); @@ -57,11 +57,11 @@ export function ComponentGlobal_AvatarAndUsername({ )} - - + + onCheckProfile()} > @@ -72,7 +72,9 @@ export function ComponentGlobal_AvatarAndUsername({ {component && ( - {component} + + {component} + )} diff --git a/src/app_modules/_global/component/comp_card_box_and_background.tsx b/src/app_modules/_global/component/comp_card_box_and_background.tsx index de1f951c..c3064edd 100644 --- a/src/app_modules/_global/component/comp_card_box_and_background.tsx +++ b/src/app_modules/_global/component/comp_card_box_and_background.tsx @@ -28,11 +28,11 @@ export function ComponentGlobal_CardStyles({ : AccentColor.darkblue, border: `2px solid ${border ? border : AccentColor.blue}`, paddingInline: "16px", - paddingBlock: "20px", + paddingBlock: "16px", borderRadius: "10px", color: color ? color : "white", height: height ? height : "auto", - marginBottom: marginBottom ? marginBottom : "0x", + marginBottom: marginBottom ? marginBottom : "15px", }} onClick={onClickHandler} > diff --git a/src/app_modules/_global/component/comp_load_image.tsx b/src/app_modules/_global/component/comp_load_image.tsx index 031d96ce..07823211 100644 --- a/src/app_modules/_global/component/comp_load_image.tsx +++ b/src/app_modules/_global/component/comp_load_image.tsx @@ -1,13 +1,12 @@ "use client"; -import { AspectRatio, Box, Center, Image, Skeleton } from "@mantine/core"; -import { useShallowEffect } from "@mantine/hooks"; -import { useState } from "react"; -import ComponentGlobal_Loader from "./loader"; -import { useRouter } from "next/navigation"; import { APIs } from "@/app/lib"; -import { routerImagePreview } from "@/app/lib/router_hipmi/router_image_preview"; import { pathAssetImage } from "@/app/lib/path_asset_image"; +import { routerImagePreview } from "@/app/lib/router_hipmi/router_image_preview"; +import { Center, Image, Skeleton } from "@mantine/core"; +import { useShallowEffect } from "@mantine/hooks"; +import { useRouter } from "next/navigation"; +import { useState } from "react"; type IRadius = "xs" | "sm" | "md" | "lg" | "xl"; export function ComponentGlobal_LoadImage({ diff --git a/src/app_modules/_global/component/comp_not_user_load_image.tsx b/src/app_modules/_global/component/comp_not_user_load_image.tsx new file mode 100644 index 00000000..481c13ec --- /dev/null +++ b/src/app_modules/_global/component/comp_not_user_load_image.tsx @@ -0,0 +1,93 @@ +"use client"; + +import { APIs } from "@/app/lib"; +import { pathAssetImage } from "@/app/lib/path_asset_image"; +import { routerImagePreview } from "@/app/lib/router_hipmi/router_image_preview"; +import { Center, Image, Skeleton } from "@mantine/core"; +import { useShallowEffect } from "@mantine/hooks"; +import { useRouter } from "next/navigation"; +import { useState } from "react"; + +type IRadius = "xs" | "sm" | "md" | "lg" | "xl"; +export function ComponentGlobal_NotUserLoadImage({ + fileId, + maw, + radius, +}: { + fileId: string; + maw?: number | string; + radius?: IRadius; +}) { + const router = useRouter(); + const [isImage, setIsImage] = useState(null); + const [isLoading, setIsLoading] = useState(false); + + const url = APIs.GET({ fileId: fileId }); + + useShallowEffect(() => { + onLoadImage(); + }, []); + + async function onLoadImage() { + try { + const res = await fetch(url); + if (res.ok) { + return setIsImage(true); + } + setIsImage(false); + } catch (error) { + console.log(error); + } + } + + if (isImage === null) + return ( +
+ +
+ ); + + if (!isImage) + return ( + <> +
+ No Image +
+ + ); + + return ( + <> +
+ { + setIsLoading(true); + router.push(routerImagePreview.not_user_image({ id: fileId }), { + scroll: false, + }); + }} + opacity={isLoading ? 0.5 : 1} + radius={radius ? radius : 0} + alt="Image" + maw={maw ? maw : 200} + miw={200} + src={url} + /> + + {isLoading ? ( + Loader + ) : ( + "" + )} +
+ + ); +} diff --git a/src/app_modules/_global/component/index.ts b/src/app_modules/_global/component/index.ts index 3747da1e..38e99457 100644 --- a/src/app_modules/_global/component/index.ts +++ b/src/app_modules/_global/component/index.ts @@ -7,6 +7,7 @@ import { ComponentGlobal_CardStyles } from "./comp_card_box_and_background"; import { ComponentGlobal_LoaderAvatar } from "./comp_load_avatar"; import { ComponentGlobal_LoadImage } from "./comp_load_image"; import ComponentGlobal_CardLoadingOverlay from "./comp_loading_card"; +import { ComponentGlobal_NotUserLoadImage } from "./comp_not_user_load_image"; import ComponentGlobal_TampilanAngkaRatusan from "./comp_tampilan_angka_ratusan"; import ComponentGlobal_TampilanRupiah from "./comp_tampilan_rupiah"; import ComponentGlobal_ErrorInput from "./error_input"; @@ -25,3 +26,4 @@ export { ComponentGlobal_ErrorInput }; export { ComponentGlobal_ButtonUploadFileImage }; export { ComponentGlobal_LoaderAvatar }; export { ComponentGlobal_AvatarAndUsername }; +export { ComponentGlobal_NotUserLoadImage }; diff --git a/src/app_modules/_global/ui/index.ts b/src/app_modules/_global/ui/index.ts index 05a6acb6..73027096 100644 --- a/src/app_modules/_global/ui/index.ts +++ b/src/app_modules/_global/ui/index.ts @@ -1,8 +1,10 @@ import UIGlobal_Drawer from "./ui_drawer"; import UIGlobal_LayoutHeaderTamplate from "./ui_header_tamplate"; import { UIGlobal_ImagePreview } from "./ui_image_preview"; +import UIGlobal_LayoutDefault from "./ui_layout_default"; import UIGlobal_LayoutTamplate from "./ui_layout_tamplate"; import UIGlobal_Modal from "./ui_modal"; +import { UIGlobal_NotUserImagePreview } from "./ui_not_user_image_preview"; import UIGlobal_SplashScreen from "./ui_splash"; export { UIGlobal_LayoutTamplate }; @@ -11,3 +13,5 @@ export { UIGlobal_Drawer }; export { UIGlobal_Modal }; export { UIGlobal_SplashScreen }; export { UIGlobal_ImagePreview }; +export { UIGlobal_NotUserImagePreview }; +export { UIGlobal_LayoutDefault }; diff --git a/src/app_modules/_global/ui/ui_layout_default.tsx b/src/app_modules/_global/ui/ui_layout_default.tsx new file mode 100644 index 00000000..0c09d13e --- /dev/null +++ b/src/app_modules/_global/ui/ui_layout_default.tsx @@ -0,0 +1,45 @@ +"use client"; + +import { + BackgroundImage, + Box, + Container, + rem, + ScrollArea, +} from "@mantine/core"; +import { MainColor } from "../color"; + +export default function UIGlobal_LayoutDefault({ + children, +}: { + children: React.ReactNode; +}) { + return ( + <> + + + + + + {children} + + + + + + + ); +} diff --git a/src/app_modules/_global/ui/ui_layout_tamplate.tsx b/src/app_modules/_global/ui/ui_layout_tamplate.tsx index da1f4703..6327fc97 100644 --- a/src/app_modules/_global/ui/ui_layout_tamplate.tsx +++ b/src/app_modules/_global/ui/ui_layout_tamplate.tsx @@ -4,12 +4,11 @@ import { BackgroundImage, Box, Container, - Footer, rem, - ScrollArea, + ScrollArea } from "@mantine/core"; -import { AccentColor, MainColor } from "../color/color_pallet"; import React from "react"; +import { AccentColor, MainColor } from "../color/color_pallet"; export default function UIGlobal_LayoutTamplate({ children, diff --git a/src/app_modules/_global/ui/ui_not_user_image_preview.tsx b/src/app_modules/_global/ui/ui_not_user_image_preview.tsx new file mode 100644 index 00000000..134c594f --- /dev/null +++ b/src/app_modules/_global/ui/ui_not_user_image_preview.tsx @@ -0,0 +1,107 @@ +"use client"; + +import { APIs } from "@/app/lib"; +import { pathAssetImage } from "@/app/lib/path_asset_image"; +import { + ActionIcon, + Box, + Center, + Container, + Image, + rem, + Skeleton +} from "@mantine/core"; +import { useShallowEffect } from "@mantine/hooks"; +import { IconX } from "@tabler/icons-react"; +import { useRouter } from "next/navigation"; +import { useState } from "react"; +import { MainColor } from "../color"; +import UIGlobal_LayoutHeaderTamplate from "./ui_header_tamplate"; +import { UIHeader } from "./ui_layout_tamplate"; + +export function UIGlobal_NotUserImagePreview({ fileId }: { fileId: string }) { + const router = useRouter(); + const [isImage, setIsImage] = useState(null); + + const url = APIs.GET({ fileId: fileId }); + + useShallowEffect(() => { + onLoadImage(); + }, []); + + async function onLoadImage() { + const res = await fetch(url); + try { + if (res.ok) { + return setIsImage(true); + } + setIsImage(false); + } catch (error) { + console.log(error); + } + } + + return ( + <> + + + router.back()} + variant="transparent" + > + + + } + /> + } + /> + + + {isImage === null ? ( + + ) : isImage ? ( +
+ Image +
+ ) : ( + +
+ Image +
+
+ )} +
+
+
+ + ); +} diff --git a/src/app_modules/auth/login/view.tsx b/src/app_modules/auth/login/view.tsx index cf1b432d..cb2bdc48 100644 --- a/src/app_modules/auth/login/view.tsx +++ b/src/app_modules/auth/login/view.tsx @@ -6,27 +6,19 @@ import { MainColor, } from "@/app_modules/_global/color/color_pallet"; import ComponentGlobal_ErrorInput from "@/app_modules/_global/component/error_input"; -import { auth_funLogin } from "@/app_modules/auth/fun/fun_login"; -import { - BackgroundImage, - Button, - Center, - Stack, - Text, - Title, -} from "@mantine/core"; -import { useAtom } from "jotai"; -import { useRouter } from "next/navigation"; -import { useState } from "react"; -import { PhoneInput } from "react-international-phone"; -import "react-international-phone/style.css"; -import { gs_kodeId } from "../state/state"; import { ComponentGlobal_NotifikasiBerhasil, ComponentGlobal_NotifikasiPeringatan, } from "@/app_modules/_global/notif_global"; +import { UIGlobal_LayoutDefault } from "@/app_modules/_global/ui"; +import { auth_funLogin } from "@/app_modules/auth/fun/fun_login"; +import { Box, Button, Center, Stack, Text, Title } from "@mantine/core"; +import { useRouter } from "next/navigation"; +import { useState } from "react"; +import { PhoneInput } from "react-international-phone"; +import "react-international-phone/style.css"; -export default function Login() { +export default function Login({ version }: { version: string }) { const router = useRouter(); const [phone, setPhone] = useState(""); const [loading, setLoading] = useState(false); @@ -56,11 +48,7 @@ export default function Login() { return ( <> - + @@ -104,8 +92,19 @@ export default function Login() { LOGIN </Button> </Stack> + + <Box pos={"fixed"} bottom={10}> + <Text fw={"bold"} c={"white"} fs={"italic"} fz={"xs"}> + V.{version} + </Text> + </Box> </Stack> - </BackgroundImage> + </UIGlobal_LayoutDefault> + {/* <BackgroundImage + src={"/aset/global/main_background.png"} + h={"100vh"} + // pos={"static"} + ></BackgroundImage> */} </> ); } diff --git a/src/app_modules/auth/register/view.tsx b/src/app_modules/auth/register/view.tsx index ddfbea56..edc86465 100644 --- a/src/app_modules/auth/register/view.tsx +++ b/src/app_modules/auth/register/view.tsx @@ -1,6 +1,7 @@ "use client"; import { RouterHome } from "@/app/lib/router_hipmi/router_home"; +import { GlobalEnv } from "@/app/lib/token"; import { AccentColor, MainColor, @@ -8,14 +9,14 @@ import { import ComponentGlobal_ErrorInput from "@/app_modules/_global/component/error_input"; import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil"; import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan"; +import { UIGlobal_LayoutDefault } from "@/app_modules/_global/ui"; import { - BackgroundImage, Button, Center, Stack, Text, TextInput, - Title, + Title } from "@mantine/core"; import { useFocusTrap } from "@mantine/hooks"; import { IconUserCircle } from "@tabler/icons-react"; @@ -24,7 +25,6 @@ import { useRouter } from "next/navigation"; import { useState } from "react"; import { auth_funDeleteAktivasiKodeOtpById } from "../fun/fun_edit_aktivasi_kode_otp_by_id"; import { Auth_funRegister } from "../fun/fun_register"; -import { GlobalEnv } from "@/app/lib/token"; export default function Register({ dataOtp }: { dataOtp: any }) { const router = useRouter(); @@ -68,7 +68,7 @@ export default function Register({ dataOtp }: { dataOtp: any }) { return ( <> - <BackgroundImage src={"/aset/global/main_background.png"} h={"100vh"}> + <UIGlobal_LayoutDefault> <Center h={"100vh"}> <Stack h={"100%"} align="center" justify="center" spacing={70}> <Title order={2} c={MainColor.yellow}> @@ -130,7 +130,7 @@ export default function Register({ dataOtp }: { dataOtp: any }) { </Stack> </Stack> </Center> - </BackgroundImage> + </UIGlobal_LayoutDefault> </> ); } diff --git a/src/app_modules/auth/splash/view.tsx b/src/app_modules/auth/splash/view.tsx index b017dd7f..42557672 100644 --- a/src/app_modules/auth/splash/view.tsx +++ b/src/app_modules/auth/splash/view.tsx @@ -1,5 +1,7 @@ "use client"; +import { RouterAuth } from "@/app/lib/router_hipmi/router_auth"; +import { RouterHome } from "@/app/lib/router_hipmi/router_home"; import { MainColor } from "@/app_modules/_global/color/color_pallet"; import UIGlobal_SplashScreen from "@/app_modules/_global/ui/ui_splash"; import { @@ -19,11 +21,11 @@ export default function SplashScreen({ userLoginId }: { userLoginId: any }) { useShallowEffect(() => { if (!userLoginId) { setTimeout(() => { - return router.push("/dev/auth/login", { scroll: false }); + return router.push(RouterAuth.login, { scroll: false }); }, 1000); } else { setTimeout(() => { - return router.push("/dev/home", { scroll: false }); + return router.push(RouterHome.main_home, { scroll: false }); }, 1000); } }, []); diff --git a/src/app_modules/auth/validasi/view.tsx b/src/app_modules/auth/validasi/view.tsx index ebc4687a..23ccf333 100644 --- a/src/app_modules/auth/validasi/view.tsx +++ b/src/app_modules/auth/validasi/view.tsx @@ -27,6 +27,7 @@ import { useState } from "react"; import { auth_funDeleteAktivasiKodeOtpById } from "../fun/fun_edit_aktivasi_kode_otp_by_id"; import { auth_funValidasi } from "../fun/fun_validasi"; import { GlobalEnv } from "@/app/lib/token"; +import { UIGlobal_LayoutDefault } from "@/app_modules/_global/ui"; export default function Validasi({ dataOtp }: { dataOtp: any }) { const router = useRouter(); @@ -86,11 +87,7 @@ export default function Validasi({ dataOtp }: { dataOtp: any }) { return ( <> - <BackgroundImage - src={"/aset/global/main_background.png"} - h={"100vh"} - // pos={"static"} - > + <UIGlobal_LayoutDefault> <Stack h={"100vh"}> <Box pt={"md"} @@ -154,7 +151,7 @@ export default function Validasi({ dataOtp }: { dataOtp: any }) { </Button> </Stack> </Stack> - </BackgroundImage> + </UIGlobal_LayoutDefault> </> ); } diff --git a/src/app_modules/colab/component/card_view/card_beranda.tsx b/src/app_modules/colab/component/card_view/card_beranda.tsx index 1c1ecbf3..042d02b1 100644 --- a/src/app_modules/colab/component/card_view/card_beranda.tsx +++ b/src/app_modules/colab/component/card_view/card_beranda.tsx @@ -1,12 +1,10 @@ import { RouterColab } from "@/app/lib/router_hipmi/router_colab"; -import { AccentColor } from "@/app_modules/_global/color/color_pallet"; -import { Card, Stack } from "@mantine/core"; +import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component"; +import { Stack } from "@mantine/core"; import { MODEL_COLLABORATION } from "../../model/interface"; import ComponentColab_CardSectionData from "./card_section_data"; import ComponentColab_CardSectionHeaderAuthorName from "./card_section_header_author_name"; import ComponentColab_JumlahPartisipan from "./card_section_jumlah_partisipan"; -import { useRouter } from "next/navigation"; -import { useState } from "react"; export function ComponentColab_CardBeranda({ data, @@ -15,28 +13,14 @@ export function ComponentColab_CardBeranda({ data: MODEL_COLLABORATION; userLoginId: string; }) { - const router = useRouter(); - const [loadingCreate, setLoadingCreate] = useState(false); - return ( <> - <Card - style={{ - border: `2px solid ${AccentColor.blue}`, - backgroundColor: AccentColor.darkblue, - color: "white", - borderRadius: "10px", - marginBottom: "20px", - padding: "15px", - }} - > + <ComponentGlobal_CardStyles marginBottom={"15px"}> <Stack> <ComponentColab_CardSectionHeaderAuthorName - authorName={data?.Author?.Profile?.name} - imagesId={data?.Author?.Profile?.imagesId} - profileId={data?.Author?.Profile?.id} isAuthor={userLoginId === data.Author.id ? true : false} colabId={data.id} + profile={data.Author.Profile as any} /> <ComponentColab_CardSectionData colabId={data.id} @@ -47,7 +31,7 @@ export function ComponentColab_CardBeranda({ jumlah={data.ProjectCollaboration_Partisipasi} /> </Stack> - </Card> + </ComponentGlobal_CardStyles> </> ); } diff --git a/src/app_modules/colab/component/card_view/card_proyek_saya.tsx b/src/app_modules/colab/component/card_view/card_proyek_saya.tsx index e99d4415..271d6e82 100644 --- a/src/app_modules/colab/component/card_view/card_proyek_saya.tsx +++ b/src/app_modules/colab/component/card_view/card_proyek_saya.tsx @@ -1,23 +1,14 @@ -import { RouterColab } from "@/app/lib/router_hipmi/router_colab"; +import { AccentColor } from "@/app_modules/_global/color/color_pallet"; import { Card, Stack } from "@mantine/core"; +import { MODEL_COLLABORATION } from "../../model/interface"; import ComponentColab_CardSectionData from "./card_section_data"; import ComponentColab_JumlahPartisipan from "./card_section_jumlah_partisipan"; -import { MODEL_COLLABORATION } from "../../model/interface"; -import { AccentColor } from "@/app_modules/_global/color/color_pallet"; +import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component"; export function ComponentColab_CardProyekSaya({data, path}: {data: MODEL_COLLABORATION, path: string}) { return ( <> - <Card - style={{ - padding: "15px", - backgroundColor: AccentColor.darkblue, - borderRadius: "10px", - border: `2px solid ${AccentColor.blue}`, - color: "white", - marginBottom: "15px", - }} - > + <ComponentGlobal_CardStyles marginBottom={"15px"}> <Stack> <ComponentColab_CardSectionData colabId={data.id} @@ -28,7 +19,7 @@ export function ComponentColab_CardProyekSaya({data, path}: {data: MODEL_COLLABO jumlah={data.ProjectCollaboration_Partisipasi} /> </Stack> - </Card> + </ComponentGlobal_CardStyles> </> ); } \ No newline at end of file diff --git a/src/app_modules/colab/component/card_view/card_section_data.tsx b/src/app_modules/colab/component/card_view/card_section_data.tsx index 971efb30..c527562d 100644 --- a/src/app_modules/colab/component/card_view/card_section_data.tsx +++ b/src/app_modules/colab/component/card_view/card_section_data.tsx @@ -4,6 +4,8 @@ import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/noti import { Card, Center, Grid, Stack, Text, Title } from "@mantine/core"; import { useRouter } from "next/navigation"; import { MODEL_COLLABORATION } from "../../model/interface"; +import { useState } from "react"; +import { ComponentGlobal_CardLoadingOverlay } from "@/app_modules/_global/component"; export default function ComponentColab_CardSectionData({ colabId, @@ -15,6 +17,7 @@ export default function ComponentColab_CardSectionData({ data?: MODEL_COLLABORATION; }) { const router = useRouter(); + const [visible, setVisible] = useState(false); return ( <> @@ -22,6 +25,7 @@ export default function ComponentColab_CardSectionData({ px={"md"} onClick={() => { if (path) { + setVisible(true); router.push(path + colabId); } else { ComponentGlobal_NotifikasiPeringatan("Path tidak ditemukan"); @@ -79,6 +83,7 @@ export default function ComponentColab_CardSectionData({ </Text> </Stack> </Stack> + {visible && <ComponentGlobal_CardLoadingOverlay />} </Card.Section> </> ); diff --git a/src/app_modules/colab/component/card_view/card_section_header_author_name.tsx b/src/app_modules/colab/component/card_view/card_section_header_author_name.tsx index 52eb161f..af952e66 100644 --- a/src/app_modules/colab/component/card_view/card_section_header_author_name.tsx +++ b/src/app_modules/colab/component/card_view/card_section_header_author_name.tsx @@ -1,87 +1,74 @@ "use client"; -import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/_global/author_name_on_header"; -import { - ActionIcon, - Avatar, - Card, - Divider, - Grid, - Menu, - Stack, - Text, -} from "@mantine/core"; -import ComponentColab_AuthorNameOnHeader from "../header_author_name"; -import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog"; -import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan"; -import { useRouter } from "next/navigation"; -import { IconDots, IconEdit } from "@tabler/icons-react"; import { RouterColab } from "@/app/lib/router_hipmi/router_colab"; -import { useDisclosure } from "@mantine/hooks"; -import { useState } from "react"; +import { ComponentGlobal_AvatarAndUsername } from "@/app_modules/_global/component"; import UIGlobal_Drawer from "@/app_modules/_global/ui/ui_drawer"; +import { ActionIcon, Group, Stack } from "@mantine/core"; +import { IconDots, IconEdit } from "@tabler/icons-react"; +import { useRouter } from "next/navigation"; +import { useState } from "react"; export default function ComponentColab_CardSectionHeaderAuthorName({ - profileId, - imagesId, - authorName, - isPembatas, isAuthor, colabId, + profile, }: { - profileId?: string; - imagesId?: string; - authorName?: string; - isPembatas?: boolean; isAuthor?: boolean; colabId?: string; + profile?: any; }) { const router = useRouter(); return ( <> - <Card.Section px={"md"}> - <Stack spacing={"xs"}> - <Grid> - <Grid.Col - span={"content"} - onClick={() => { - if (profileId) { - router.push(RouterProfile.katalogOLD + profileId); - } else { - ComponentGlobal_NotifikasiPeringatan("Id tidak ditemukan"); - } - }} - > - <Avatar - size={30} - sx={{ borderStyle: "solid", borderWidth: "0.5px" }} - radius={"xl"} - bg={"gray.1"} - src={ - imagesId - ? RouterProfile.api_foto_profile + imagesId - : "/aset/global/avatar.png" - } - /> - </Grid.Col> - <Grid.Col span={"auto"}> - <Stack justify="center" h={"100%"}> - <Text lineClamp={1} fz={"sm"} fw={"bold"}> - {authorName ? authorName : "Nama author"} - </Text> - </Stack> - </Grid.Col> - <Grid.Col span={"content"}> + <Stack spacing={"xs"}> + <ComponentGlobal_AvatarAndUsername + profile={profile} + component={ + <Group position="right"> <ButtonAction isAuthor={isAuthor as any} colabId={colabId as any} /> - </Grid.Col> - </Grid> - {isPembatas ? <Divider /> : ""} - </Stack> - </Card.Section> + </Group> + } + /> + + {/* <Grid> + <Grid.Col + span={"content"} + onClick={() => { + if (profileId) { + router.push(RouterProfile.katalogOLD + profileId); + } else { + ComponentGlobal_NotifikasiPeringatan("Id tidak ditemukan"); + } + }} + > + <Avatar + size={30} + sx={{ borderStyle: "solid", borderWidth: "0.5px" }} + radius={"xl"} + bg={"gray.1"} + src={ + imagesId + ? RouterProfile.api_foto_profile + imagesId + : "/aset/global/avatar.png" + } + /> + </Grid.Col> + <Grid.Col span={"auto"}> + <Stack justify="center" h={"100%"}> + <Text lineClamp={1} fz={"sm"} fw={"bold"}> + {authorName ? authorName : "Nama author"} + </Text> + </Stack> + </Grid.Col> + <Grid.Col span={"content"}> + </Grid.Col> + </Grid> */} + {/* {isPembatas ? <Divider /> : ""} */} + </Stack> </> ); } @@ -94,7 +81,7 @@ function ButtonAction({ colabId: string; }) { const router = useRouter(); - const [openDrawe, setOpenDrawer] = useState(false); + const [openDrawer, setOpenDrawer] = useState(false); const listPage = [ { @@ -107,40 +94,12 @@ function ButtonAction({ return ( <> - {/* <Menu - opened={opened} - onChange={setOpened} - position="left-start" - offset={0} - shadow="lg" - withArrow - arrowPosition="center" - > - <Menu.Target > - <Stack justify="center" h={"100%"} > - <ActionIcon variant="transparent"> - {isAuthor ? <IconDots size={20} /> : ""} - </ActionIcon> - </Stack> - </Menu.Target> - <Menu.Dropdown bg={"gray.1"} > - <Menu.Item - icon={<IconEdit size={15} />} - onClick={() => { - router.push(RouterColab.edit + colabId); - }} - > - Edit - </Menu.Item> - </Menu.Dropdown> - </Menu> */} - <ActionIcon variant="transparent" onClick={() => setOpenDrawer(true)}> {isAuthor ? <IconDots size={20} color="white" /> : ""} </ActionIcon> <UIGlobal_Drawer - opened={openDrawe} + opened={openDrawer} close={() => setOpenDrawer(false)} component={listPage} /> diff --git a/src/app_modules/colab/component/card_view/card_section_jumlah_partisipan.tsx b/src/app_modules/colab/component/card_view/card_section_jumlah_partisipan.tsx index af073874..404e7f04 100644 --- a/src/app_modules/colab/component/card_view/card_section_jumlah_partisipan.tsx +++ b/src/app_modules/colab/component/card_view/card_section_jumlah_partisipan.tsx @@ -1,7 +1,6 @@ "use client"; -import { Stack, Divider, Center, Text, Grid, Card } from "@mantine/core"; -import { IconUsersGroup } from "@tabler/icons-react"; +import { Card, Center, Divider, Grid, Stack, Text } from "@mantine/core"; export default function ComponentColab_JumlahPartisipan({ jumlah, @@ -10,18 +9,18 @@ export default function ComponentColab_JumlahPartisipan({ }) { return ( <> - <Card.Section px={"md"}> + <Card.Section px={"md"} > <Stack> <Divider /> <Center> <Grid> <Grid.Col span={"content"}> - <Text c={"gray"} fz={"xs"} fw={"bold"}> + <Text c={"white"} fz={"xs"} fw={"bold"}> {jumlah?.length ? jumlah?.length : 0} </Text> </Grid.Col> <Grid.Col span={"auto"}> - <Text c={"gray"} fz={"xs"} fw={"bold"}> + <Text c={"white"} fz={"xs"} fw={"bold"}> Partisipan </Text> </Grid.Col> diff --git a/src/app_modules/colab/component/card_view/card_semua_partisipan.tsx b/src/app_modules/colab/component/card_view/card_semua_partisipan.tsx index 2354a2af..709009e5 100644 --- a/src/app_modules/colab/component/card_view/card_semua_partisipan.tsx +++ b/src/app_modules/colab/component/card_view/card_semua_partisipan.tsx @@ -1,13 +1,11 @@ -import { Card, Stack } from "@mantine/core"; +import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component"; +import { Stack } from "@mantine/core"; import { - MODEL_COLLABORATION, - MODEL_COLLABORATION_PARTISIPASI, + MODEL_COLLABORATION_PARTISIPASI } from "../../model/interface"; -import { RouterColab } from "@/app/lib/router_hipmi/router_colab"; import ComponentColab_CardSectionData from "./card_section_data"; import ComponentColab_CardSectionHeaderAuthorName from "./card_section_header_author_name"; import ComponentColab_JumlahPartisipan from "./card_section_jumlah_partisipan"; -import { AccentColor } from "@/app_modules/_global/color/color_pallet"; export function ComponentColab_CardSemuaPartisipan({ data, @@ -18,21 +16,11 @@ export function ComponentColab_CardSemuaPartisipan({ }) { return ( <> - <Card - style={{ - padding: "15px", - backgroundColor: AccentColor.darkblue, - borderRadius: "10px", - border: `2px solid ${AccentColor.blue}`, - color: "white", - marginBottom: "15px", - }} - > + <ComponentGlobal_CardStyles marginBottom={"15px"}> <Stack> + {/* <pre>{JSON.stringify(data, null, 2)}</pre> */} <ComponentColab_CardSectionHeaderAuthorName - authorName={data?.ProjectCollaboration.Author.Profile.name} - imagesId={data?.ProjectCollaboration.Author.Profile.imagesId} - profileId={data?.ProjectCollaboration.Author.Profile.id} + profile={data?.ProjectCollaboration.Author.Profile} /> <ComponentColab_CardSectionData colabId={data?.ProjectCollaboration.id} @@ -43,7 +31,7 @@ export function ComponentColab_CardSemuaPartisipan({ jumlah={data?.ProjectCollaboration.ProjectCollaboration_Partisipasi} /> </Stack> - </Card> + </ComponentGlobal_CardStyles> </> ); } diff --git a/src/app_modules/colab/component/detail/header_author_list_partisipan.tsx b/src/app_modules/colab/component/detail/header_author_list_partisipan.tsx index 5809f048..d1aed031 100644 --- a/src/app_modules/colab/component/detail/header_author_list_partisipan.tsx +++ b/src/app_modules/colab/component/detail/header_author_list_partisipan.tsx @@ -1,13 +1,13 @@ "use client"; import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog"; -import { AccentColor } from "@/app_modules/_global/color/color_pallet"; +import { AccentColor, MainColor } from "@/app_modules/_global/color/color_pallet"; +import { ComponentGlobal_AvatarAndUsername } from "@/app_modules/_global/component"; import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan"; import { MODEL_USER } from "@/app_modules/home/model/interface"; import { ActionIcon, Avatar, - Button, Divider, Drawer, Grid, @@ -16,7 +16,7 @@ import { ScrollArea, Stack, Text, - Title, + Title } from "@mantine/core"; import { useDisclosure } from "@mantine/hooks"; import { IconCaretRight, IconX } from "@tabler/icons-react"; @@ -89,8 +89,27 @@ export default function ComponentColab_AuthorNameOnListPartisipan({ </Stack> </Drawer> - <Stack spacing={"xs"}> - <Grid> + <Stack spacing={"xs"} p={"xs"}> + <ComponentGlobal_AvatarAndUsername + profile={author?.Profile as any} + fontSize={"sm"} + component={ + <Stack justify="center" align="flex-end" h={"100%"}> + {deskripsi ? ( + <ActionIcon + onClick={() => open()} + radius={"xl"} + variant="transparent" + > + <IconCaretRight color={MainColor.yellow} /> + </ActionIcon> + ) : ( + "" + )} + </Stack> + } + /> + {/* <Grid> <Grid.Col span={"content"} onClick={() => { @@ -136,7 +155,7 @@ export default function ComponentColab_AuthorNameOnListPartisipan({ </Stack> </Grid.Col> </Grid> - {isPembatas ? <Divider /> : ""} + {isPembatas ? <Divider /> : ""} */} </Stack> </> ); diff --git a/src/app_modules/colab/component/detail/list_partisipasi_user.tsx b/src/app_modules/colab/component/detail/list_partisipasi_user.tsx index aab5568a..94a65e62 100644 --- a/src/app_modules/colab/component/detail/list_partisipasi_user.tsx +++ b/src/app_modules/colab/component/detail/list_partisipasi_user.tsx @@ -30,6 +30,7 @@ import { MODEL_COLLABORATION_PARTISIPASI } from "../../model/interface"; import ComponentColab_AuthorNameOnListPartisipan from "./header_author_list_partisipan"; import notifikasiToUser_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_user"; import mqtt_client from "@/util/mqtt_client"; + export default function ComponentColab_DetailListPartisipasiUser({ listPartisipan, userLoginId, @@ -117,6 +118,7 @@ export default function ComponentColab_DetailListPartisipasiUser({ }, }} > + <Stack spacing={"xs"}> <Group position="right"> <ActionIcon onClick={close} variant="transparent"> @@ -125,7 +127,7 @@ export default function ComponentColab_DetailListPartisipasiUser({ </Group> <Textarea maxLength={300} - label="Deskripsi Diri" + label={<Text c={"white"} mb={"sm"} fw={"bold"}>Deskripsi Diri</Text>} placeholder="Deskripsikan diri anda yang sesuai dengan proyek ini.." minRows={4} onChange={(val) => { @@ -179,7 +181,6 @@ export default function ComponentColab_DetailListPartisipasiUser({ backgroundColor: AccentColor.blue, color: "white", borderRadius: "10px", - marginBottom: "20px", padding: "15px", }} > diff --git a/src/app_modules/colab/component/header_author_name.tsx b/src/app_modules/colab/component/header_author_name.tsx index f022ae42..958bbeb3 100644 --- a/src/app_modules/colab/component/header_author_name.tsx +++ b/src/app_modules/colab/component/header_author_name.tsx @@ -1,31 +1,38 @@ "use client"; -import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog"; -import { Stack, Grid, Avatar, Divider, Text, Group } from "@mantine/core"; +import { ComponentGlobal_AvatarAndUsername } from "@/app_modules/_global/component"; +import { Group, Stack, Text } from "@mantine/core"; import { useRouter } from "next/navigation"; -import moment from "moment"; -import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan"; export default function ComponentColab_AuthorNameOnHeader({ - profileId, - imagesId, - authorName, tglPublish, - isPembatas, + profile, }: { - profileId?: string; - imagesId?: string; - authorName?: string; tglPublish?: Date; - isPembatas?: boolean; + profile: any; }) { const router = useRouter(); return ( <> - <Stack spacing={"xs"} style={{ - color: "white" - }}> - <Grid> + <ComponentGlobal_AvatarAndUsername + profile={profile} + component={ + <Group position="right"> + {tglPublish ? ( + <Text fz={"xs"}> + {new Intl.DateTimeFormat("id-ID", { + dateStyle: "medium", + }).format(tglPublish)} + </Text> + ) : ( + "" + )} + </Group> + } + /> + + <Stack spacing={"xs"}> + {/* <Grid> <Grid.Col span={"content"} onClick={() => { @@ -69,8 +76,7 @@ export default function ComponentColab_AuthorNameOnHeader({ )} </Stack> </Grid.Col> - </Grid> - {isPembatas ? <Divider /> : ""} + </Grid> */} </Stack> </> ); diff --git a/src/app_modules/colab/detail/info_grup/index.tsx b/src/app_modules/colab/detail/info_grup/index.tsx index 0d0db2e8..e0aeade4 100644 --- a/src/app_modules/colab/detail/info_grup/index.tsx +++ b/src/app_modules/colab/detail/info_grup/index.tsx @@ -1,14 +1,12 @@ "use client"; -import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate"; -import { Box, Paper, Stack, Text, Title } from "@mantine/core"; -import ComponentColab_HeaderTamplate from "../../component/header_tamplate"; -import { MODEL_COLLABORATION_ROOM_CHAT } from "../../model/interface"; -import ComponentColab_DetailData from "../../component/detail/detail_data"; -import ComponentColab_AuthorNameOnListPartisipan from "../../component/detail/header_author_list_partisipan"; -import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate"; -import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate"; import { AccentColor } from "@/app_modules/_global/color/color_pallet"; +import { ComponentGlobal_AvatarAndUsername, ComponentGlobal_CardStyles } from "@/app_modules/_global/component"; +import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate"; +import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate"; +import { Box, Paper, Stack, Title } from "@mantine/core"; +import ComponentColab_DetailData from "../../component/detail/detail_data"; +import { MODEL_COLLABORATION_ROOM_CHAT } from "../../model/interface"; export default function Colab_DetailInfoGrup({ dataRoom, @@ -20,7 +18,7 @@ export default function Colab_DetailInfoGrup({ <UIGlobal_LayoutTamplate header={<UIGlobal_LayoutHeaderTamplate title="Info Grup" />} > - {<InfoGroup dataRoom={dataRoom} />} + <InfoGroup dataRoom={dataRoom} /> </UIGlobal_LayoutTamplate> </> ); @@ -29,42 +27,30 @@ export default function Colab_DetailInfoGrup({ function InfoGroup({ dataRoom }: { dataRoom: MODEL_COLLABORATION_ROOM_CHAT }) { return ( <> - <Stack - px={"xs"} - style={{ - border: `2px solid ${AccentColor.blue}`, - backgroundColor: AccentColor.darkblue, - color: "white", - borderRadius: "10px", - marginBottom: "20px", - padding: "15px", - }} - > - <ComponentColab_DetailData data={dataRoom.ProjectCollaboration} /> - <Paper - - style={{ - border: `2px solid ${AccentColor.softblue}`, - backgroundColor: AccentColor.blue, - color: "white", - borderRadius: "10px", - marginBottom: "20px", - padding: "15px", - }} - > - <Stack> - <Title order={6}>Anggota Grup - {dataRoom.ProjectCollaboration_AnggotaRoomChat.map((e, i) => ( - - - - ))} - - - + + + + + + Anggota Grup + {dataRoom.ProjectCollaboration_AnggotaRoomChat.map((e, i) => ( + + + + + ))} + + + + ); } diff --git a/src/app_modules/colab/detail/main_detail/index.tsx b/src/app_modules/colab/detail/main_detail/index.tsx index c6a3921f..34f272ca 100644 --- a/src/app_modules/colab/detail/main_detail/index.tsx +++ b/src/app_modules/colab/detail/main_detail/index.tsx @@ -1,13 +1,12 @@ "use client"; import { AccentColor } from "@/app_modules/_global/color/color_pallet"; -import { - Stack -} from "@mantine/core"; +import { Stack } from "@mantine/core"; import ComponentColab_DetailData from "../../component/detail/detail_data"; import ComponentColab_DetailListPartisipasiUser from "../../component/detail/list_partisipasi_user"; import ComponentColab_AuthorNameOnHeader from "../../component/header_author_name"; import { MODEL_COLLABORATION } from "../../model/interface"; +import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component"; export default function Colab_MainDetail({ dataColab, @@ -18,37 +17,26 @@ export default function Colab_MainDetail({ dataColab?: MODEL_COLLABORATION; userLoginId?: string; listPartisipan?: any[]; - cekPartisipan: boolean + cekPartisipan: boolean; }) { return ( <> - - - - - + + + + + + + ); } diff --git a/src/app_modules/colab/detail/notifikasi/index.tsx b/src/app_modules/colab/detail/notifikasi/index.tsx deleted file mode 100644 index 7d450de2..00000000 --- a/src/app_modules/colab/detail/notifikasi/index.tsx +++ /dev/null @@ -1,37 +0,0 @@ -"use client"; - -import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate"; -import ComponentColab_HeaderTamplate from "../../component/header_tamplate"; -import { Center, Stack } from "@mantine/core"; -import { MODEL_COLLABORATION_NOTIFIKSI } from "../../model/interface"; -import ComponentColab_NotedBox from "../../component/noted_box"; -import ComponentColab_DetailData from "../../component/detail/detail_data"; - -export default function Colab_DetailNotifikasi({ - data, -}: { - data: MODEL_COLLABORATION_NOTIFIKSI; -}) { - return ( - <> - } - > - - - - ); -} - -function DetailNotif({ data }: { data?: MODEL_COLLABORATION_NOTIFIKSI }) { - return ( - <> - - - - - - ); -} diff --git a/src/app_modules/colab/detail/proyek/partisipasi/index.tsx b/src/app_modules/colab/detail/proyek/partisipasi/index.tsx index 2a5f26e9..96991c5c 100644 --- a/src/app_modules/colab/detail/proyek/partisipasi/index.tsx +++ b/src/app_modules/colab/detail/proyek/partisipasi/index.tsx @@ -1,10 +1,14 @@ "use client"; import { AccentColor } from "@/app_modules/_global/color/color_pallet"; +import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component"; import ComponentColab_DetailData from "@/app_modules/colab/component/detail/detail_data"; import ComponentColab_DetailListPartisipasiUser from "@/app_modules/colab/component/detail/list_partisipasi_user"; import ComponentColab_AuthorNameOnHeader from "@/app_modules/colab/component/header_author_name"; -import { MODEL_COLLABORATION, MODEL_COLLABORATION_PARTISIPASI } from "@/app_modules/colab/model/interface"; +import { + MODEL_COLLABORATION, + MODEL_COLLABORATION_PARTISIPASI, +} from "@/app_modules/colab/model/interface"; import { Stack, Text } from "@mantine/core"; export default function Colab_DetailPartisipasiProyek({ @@ -12,34 +16,21 @@ export default function Colab_DetailPartisipasiProyek({ listPartisipan, }: { dataColab: MODEL_COLLABORATION; - listPartisipan: MODEL_COLLABORATION_PARTISIPASI[] + listPartisipan: MODEL_COLLABORATION_PARTISIPASI[]; }) { return ( <> - - {/*
{JSON.stringify(dataColab, null,2)}
*/} - - - -
+ + + + + + + ); } diff --git a/src/app_modules/colab/detail/proyek/saya/index.tsx b/src/app_modules/colab/detail/proyek/saya/index.tsx index 2662b8d1..173f6ff5 100644 --- a/src/app_modules/colab/detail/proyek/saya/index.tsx +++ b/src/app_modules/colab/detail/proyek/saya/index.tsx @@ -5,6 +5,7 @@ import { AccentColor, MainColor, } from "@/app_modules/_global/color/color_pallet"; +import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component"; import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil"; import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal"; import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan"; @@ -17,7 +18,7 @@ import { MODEL_COLLABORATION, MODEL_COLLABORATION_PARTISIPASI, } from "@/app_modules/colab/model/interface"; -import { notifikasiToUser_CreateGroupCollaboration } from "@/app_modules/notifikasi/fun/create/create_notif_to_user_collaboration"; +import mqtt_client from "@/util/mqtt_client"; import { ActionIcon, Button, @@ -38,8 +39,6 @@ import { useAtom } from "jotai"; import _ from "lodash"; import { useRouter } from "next/navigation"; import { useState } from "react"; -import mqtt_client from "@/util/mqtt_client"; - export default function Colab_DetailProyekSaya({ dataColab, @@ -50,24 +49,15 @@ export default function Colab_DetailProyekSaya({ }) { return ( <> - - - - + + + + + + ); } @@ -119,8 +109,8 @@ function CheckBoxPartisipan({ ) : ( listPartisipan.map((e, i) => ( - - + + setOpenDrawer(true)} - - > - + } /> @@ -51,10 +49,9 @@ export default function LayoutColab_DetailProyekSaya({ setOpenDrawer(false)} - component={listPage} - + opened={openDrawer} + close={() => setOpenDrawer(false)} + component={listPage} /> ); diff --git a/src/app_modules/colab/detail/status/publish/index.tsx b/src/app_modules/colab/detail/status/publish/index.tsx deleted file mode 100644 index 95edc917..00000000 --- a/src/app_modules/colab/detail/status/publish/index.tsx +++ /dev/null @@ -1,164 +0,0 @@ -"use client"; - -import { RouterColab } from "@/app/lib/router_hipmi/router_colab"; -import ComponentColab_DetailData from "@/app_modules/colab/component/detail/detail_data"; -import ComponentColab_AuthorNameOnHeader from "@/app_modules/colab/component/header_author_name"; -import { gs_colab_hot_menu } from "@/app_modules/colab/global_state"; -import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil"; -import { - Button, - Checkbox, - Drawer, - Grid, - Group, - Paper, - ScrollArea, - Stack, - Text, - TextInput, - Title, -} from "@mantine/core"; -import { useDisclosure } from "@mantine/hooks"; -import { useAtom } from "jotai"; -import _ from "lodash"; -import { useRouter } from "next/navigation"; -import { useState } from "react"; - -export default function Colab_DetailStatusPublish() { - return ( - <> - - - - - - ); -} - -function CheckBoxPartisipan() { - const router = useRouter(); - const [value, setValue] = useState([]); - const [opened, { open, close }] = useDisclosure(false); - const [hotMenu, setHotMenu] = useAtom(gs_colab_hot_menu); - - const listCheck = [ - { - id: 1, - value: "satu", - label: "Satu", - }, - { - id: 2, - value: "dua", - label: "Dua", - }, - { - id: 3, - value: "tiga", - label: "Tiga", - }, - { - id: 4, - value: "empat", - label: "Empat", - }, - { - id: 5, - value: "lima", - label: "Lima", - }, - { - id: 6, - value: "enam", - label: "Enam", - }, - { - id: 7, - value: "tujuh", - label: "Tujuh", - }, - { - id: 8, - value: "delapan", - label: "Delapan", - }, - { - id: 9, - value: "sembilan", - label: "Sembilan", - }, - { - id: 10, - value: "sepuluh", - label: "Sepuluh", - }, - ]; - - async function onSave() { - close(); - ComponentGlobal_NotifikasiBerhasil("Berhasil Membuat Grup"); - setHotMenu(4); - router.push(RouterColab.grup_diskusi); - } - - return ( - <> - - - - * - - Pilih user yang akan menjadi tim proyek anda - - - - - - {listCheck.map((e, i) => ( - - - - - - - - - ))} - - - - - - - - - - Nama Grup Diskusi - - - - - - - - - ); -} diff --git a/src/app_modules/colab/detail/status/publish/layout.tsx b/src/app_modules/colab/detail/status/publish/layout.tsx deleted file mode 100644 index 77be69ab..00000000 --- a/src/app_modules/colab/detail/status/publish/layout.tsx +++ /dev/null @@ -1,19 +0,0 @@ -"use client"; - -import ComponentColab_HeaderTamplate from "@/app_modules/colab/component/header_tamplate"; -import { AppShell } from "@mantine/core"; -import React from "react"; - -export default function LayoutColab_DetailStatusPublish({ - children, -}: { - children: React.ReactNode; -}) { - return ( - <> - }> - {children} - - - ); -} diff --git a/src/app_modules/colab/detail/status/reject/index.tsx b/src/app_modules/colab/detail/status/reject/index.tsx deleted file mode 100644 index 98534335..00000000 --- a/src/app_modules/colab/detail/status/reject/index.tsx +++ /dev/null @@ -1,85 +0,0 @@ -"use client"; - -import ComponentColab_NotedBox from "@/app_modules/colab/component/noted_box"; -import ComponentColab_DetailData from "@/app_modules/colab/component/detail/detail_data"; -import { Button, Group, Modal, Stack, Title } from "@mantine/core"; -import { IconCheck, IconTrash, IconX } from "@tabler/icons-react"; -import { useRouter } from "next/navigation"; -import { gs_colab_status } from "@/app_modules/colab/global_state"; -import { useAtom } from "jotai"; -import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil"; -import { useDisclosure } from "@mantine/hooks"; - -export default function Colab_DetailStatusReject() { - return ( - <> - - - - - - - ); -} - -function ButtonAction() { - const router = useRouter(); - const [tabsStatus, setTabsStatus] = useAtom(gs_colab_status); - const [opened, { open, close }] = useDisclosure(false); - - async function onAjukan() { - setTabsStatus("Review"); - ComponentGlobal_NotifikasiBerhasil("Ajukan Review Berhasil"); - router.back(); - } - - async function onDelete() { - router.back(); - ComponentGlobal_NotifikasiBerhasil("Berhasil Dihapus"); - } - - return ( - <> - - - - - - - - Yakin menghapus proyek ini ? - - - - - - - - ); -} diff --git a/src/app_modules/colab/detail/status/reject/layout.tsx b/src/app_modules/colab/detail/status/reject/layout.tsx deleted file mode 100644 index be4b7d92..00000000 --- a/src/app_modules/colab/detail/status/reject/layout.tsx +++ /dev/null @@ -1,29 +0,0 @@ -"use client"; - -import { RouterColab } from "@/app/lib/router_hipmi/router_colab"; -import ComponentColab_HeaderTamplate from "@/app_modules/colab/component/header_tamplate"; -import { AppShell } from "@mantine/core"; -import { IconEdit } from "@tabler/icons-react"; -import React from "react"; - -export default function LayoutColab_DetailStatusReject({ - children, -}: { - children: React.ReactNode; -}) { - return ( - <> - } - route2={RouterColab.edit + 1} - /> - } - > - {children} - - - ); -} diff --git a/src/app_modules/colab/detail/status/review/index.tsx b/src/app_modules/colab/detail/status/review/index.tsx deleted file mode 100644 index 2cd76fd3..00000000 --- a/src/app_modules/colab/detail/status/review/index.tsx +++ /dev/null @@ -1,39 +0,0 @@ -"use client"; - -import ComponentColab_DetailData from "@/app_modules/colab/component/detail/detail_data"; -import ComponentColab_AuthorNameOnHeader from "@/app_modules/colab/component/header_author_name"; -import { gs_colab_status } from "@/app_modules/colab/global_state"; -import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil"; -import { Button, Stack } from "@mantine/core"; -import { useAtom } from "jotai"; -import { useRouter } from "next/navigation"; - -export default function Colab_DetailStatusReview() { - return ( - <> - - - - - - ); -} - -function ButtonAction() { - const router = useRouter(); - const [tabsStatus, setTabsStatus] = useAtom(gs_colab_status); - - async function onClick() { - setTabsStatus("Reject"); - router.back(); - ComponentGlobal_NotifikasiBerhasil("Berhasil Dibatalkan"); - } - - return ( - <> - - - ); -} diff --git a/src/app_modules/colab/detail/status/review/layout.tsx b/src/app_modules/colab/detail/status/review/layout.tsx deleted file mode 100644 index 40b05ab6..00000000 --- a/src/app_modules/colab/detail/status/review/layout.tsx +++ /dev/null @@ -1,21 +0,0 @@ -"use client"; - -import ComponentColab_HeaderTamplate from "@/app_modules/colab/component/header_tamplate"; -import { AppShell } from "@mantine/core"; -import React from "react"; - -export default function LayoutColab_DetailStatusReview({ - children, -}: { - children: React.ReactNode; -}) { - return ( - <> - } - > - {children} - - - ); -} diff --git a/src/app_modules/colab/fun/get/room_chat/get_list_anggota_by_room_id.ts b/src/app_modules/colab/fun/get/room_chat/get_list_anggota_by_room_id.ts index 9442f33c..b9c54bf6 100644 --- a/src/app_modules/colab/fun/get/room_chat/get_list_anggota_by_room_id.ts +++ b/src/app_modules/colab/fun/get/room_chat/get_list_anggota_by_room_id.ts @@ -31,7 +31,7 @@ export default async function colab_getListAnggotaByRoomId(roomId: string) { select: { id: true, name: true, - imagesId: true + imageId: true }, }, }, diff --git a/src/app_modules/colab/index.ts b/src/app_modules/colab/index.ts index 47fc651b..06422347 100644 --- a/src/app_modules/colab/index.ts +++ b/src/app_modules/colab/index.ts @@ -3,27 +3,18 @@ import LayoutColab_Main from "./main/layout"; import Colab_Splash from "./splash"; import Colab_Create from "./create"; import LayoutColab_Create from "./create/layout"; -import Colab_Status from "./main/status"; import Colab_MainDetail from "./detail/main_detail"; import LayoutColab_MainDetail from "./detail/main_detail/layout"; -import Colab_DetailStatusReview from "./detail/status/review"; -import LayoutColab_DetailStatusReview from "./detail/status/review/layout"; -import Colab_DetailStatusReject from "./detail/status/reject"; -import LayoutColab_DetailStatusReject from "./detail/status/reject/layout"; import Colab_Proyek from "./main/proyek"; -import Colab_DetailStatusPublish from "./detail/status/publish"; -import LayoutColab_DetailStatusPublish from "./detail/status/publish/layout"; import Colab_Edit from "./edit"; import LayoutColab_Edit from "./edit/layout"; import Colab_DetailPartisipasiProyek from "./detail/proyek/partisipasi"; import LayoutColab_DetailPartisipasiProyek from "./detail/proyek/partisipasi/layout"; import Colab_GrupDiskus from "./main/grup"; import Colab_DetailGrupDiskusi from "./detail/grup"; -import Colab_NotifikasiView from "./main/pemberitahuan"; import Colab_DetailProyekSaya from "./detail/proyek/saya"; import LayoutColab_DetailProyekSaya from "./detail/proyek/saya/layout"; import Colab_DetailInfoGrup from "./detail/info_grup"; -import Colab_DetailNotifikasi from "./detail/notifikasi"; import Colab_GroupChatView from "./detail/group"; export { @@ -32,26 +23,17 @@ export { Colab_Splash, Colab_Create, LayoutColab_Create, - Colab_Status, Colab_MainDetail, LayoutColab_MainDetail, - Colab_DetailStatusReview, - LayoutColab_DetailStatusReview, - Colab_DetailStatusReject, - LayoutColab_DetailStatusReject, Colab_Proyek, - Colab_DetailStatusPublish, - LayoutColab_DetailStatusPublish, Colab_Edit, LayoutColab_Edit, Colab_DetailPartisipasiProyek, LayoutColab_DetailPartisipasiProyek, Colab_GrupDiskus, Colab_DetailGrupDiskusi, - Colab_NotifikasiView, Colab_DetailProyekSaya, LayoutColab_DetailProyekSaya, Colab_DetailInfoGrup, - Colab_DetailNotifikasi, Colab_GroupChatView, }; diff --git a/src/app_modules/colab/main/layout.tsx b/src/app_modules/colab/main/layout.tsx index b138b3fb..03b3cd7b 100644 --- a/src/app_modules/colab/main/layout.tsx +++ b/src/app_modules/colab/main/layout.tsx @@ -30,38 +30,18 @@ export default function LayoutColab_Main({ path: RouterColab.beranda, icon: , }, - - // { - // id: 2, - // name: "Status", - // path: RouterColab.status, - // icon: , - // }, - { - id: 3, + id: 2, name: "Partisipasi", path: RouterColab.proyek, icon: , }, { - id: 4, + id: 3, name: "Grup Diskusi", path: RouterColab.grup_diskusi, icon: , }, - // { - // id: 5, - // name: "Notifikasi", - // path: RouterColab.notifikasi, - // icon: cekNotif ? ( - // - // - // - // ) : ( - // - // ), - // }, ]; return ( diff --git a/src/app_modules/colab/main/pemberitahuan/index.tsx b/src/app_modules/colab/main/pemberitahuan/index.tsx deleted file mode 100644 index 41524e3b..00000000 --- a/src/app_modules/colab/main/pemberitahuan/index.tsx +++ /dev/null @@ -1,73 +0,0 @@ -"use client"; - -import { - ActionIcon, - Center, - Group, - Paper, - Stack, - Text, - Title, -} from "@mantine/core"; -import ComponentColab_IsEmptyData from "../../component/is_empty_data"; -import _ from "lodash"; -import { MODEL_COLLABORATION_NOTIFIKSI } from "../../model/interface"; -import { IconChevronRight } from "@tabler/icons-react"; -import { useState } from "react"; -import { useRouter } from "next/navigation"; -import { RouterColab } from "@/app/lib/router_hipmi/router_colab"; -import colab_funUpdateIsReadByNotifId from "../../fun/edit/fun_is_read_by_id"; - -export default function Colab_NotifikasiView({ - listNotifikasi, -}: { - listNotifikasi?: MODEL_COLLABORATION_NOTIFIKSI[]; -}) { - const router = useRouter(); - const [notifId, setNotifId] = useState(""); - - if (_.isEmpty(listNotifikasi)) - return ; - - async function onRead(notifId: string) { - await colab_funUpdateIsReadByNotifId(notifId).then((res) => { - if (res.status === 200) { - setNotifId(notifId); - router.push(RouterColab.detail_notifikasi + notifId); - } else { - console.log(``); - } - }); - } - return ( - <> - - {listNotifikasi?.map((e, i) => ( - { - onRead(e?.id); - }} - > - - - - {e.note} - - {e.ProjectCollaboration.report} - - - - - - - ))} - - - ); -} diff --git a/src/app_modules/colab/main/proyek/saya.tsx b/src/app_modules/colab/main/proyek/saya.tsx index 8e33e64c..419e5f3a 100644 --- a/src/app_modules/colab/main/proyek/saya.tsx +++ b/src/app_modules/colab/main/proyek/saya.tsx @@ -1,19 +1,14 @@ "use client"; import { RouterColab } from "@/app/lib/router_hipmi/router_colab"; -import { Box, Card, Center, Loader, Stack } from "@mantine/core"; -import ComponentColab_CardSectionData from "../../component/card_view/card_section_data"; -import ComponentColab_CardSectionHeaderAuthorName from "../../component/card_view/card_section_header_author_name"; -import ComponentColab_JumlahPartisipan from "../../component/card_view/card_section_jumlah_partisipan"; -import { MODEL_COLLABORATION } from "../../model/interface"; +import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data"; +import { Box, Center, Loader } from "@mantine/core"; import _ from "lodash"; -import ComponentColab_IsEmptyData from "../../component/is_empty_data"; +import { ScrollOnly } from "next-scroll-loader"; import { useState } from "react"; import { ComponentColab_CardProyekSaya } from "../../component/card_view/card_proyek_saya"; -import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data"; -import { event_getAllDraft } from "@/app_modules/event/fun/get/status/get_all_draft"; -import { ScrollOnly } from "next-scroll-loader"; import colab_getListAllProyekSayaByAuthorId from "../../fun/get/pasrtisipan/get_list_proyek_saya_by_author_id"; +import { MODEL_COLLABORATION } from "../../model/interface"; export default function Colab_ProyekSaya({ listProyekSaya, diff --git a/src/app_modules/colab/main/status/index.tsx b/src/app_modules/colab/main/status/index.tsx deleted file mode 100644 index 0c7234e4..00000000 --- a/src/app_modules/colab/main/status/index.tsx +++ /dev/null @@ -1,86 +0,0 @@ -"use client"; - -import { Tabs, Stack, Paper } from "@mantine/core"; -import { useState } from "react"; -import Colab_StatusPublish from "./publish"; -import Colab_StatusReject from "./reject"; -import Colab_StatusReview from "./review"; -import { useAtom } from "jotai"; -import { gs_colab_status } from "../../global_state"; - -export default function Colab_Status({ - listPublish, - listReview, - listReject, -}: { - listPublish: any[]; - listReview: any[]; - listReject: any[]; -}) { - const [tabsStatus, setTabsStatus] = useAtom(gs_colab_status); - const [colorTab, setColorTab] = useState(""); - - const listTabs = [ - { - id: 1, - path: , - value: "Publish", - bg: "green", - }, - // { - // id: 2, - // path: , - // value: "Review", - // bg: "orange", - // }, - { - id: 3, - path: , - value: "Reject", - bg: "red", - }, - ]; - - return ( - <> - { - setTabsStatus(val); - // setColorTab(val); - }} - > - - - {listTabs.map((e) => ( - - {e.value} - - ))} - - {listTabs.map((e) => ( - - {e.path} - - ))} - - - - ); -} diff --git a/src/app_modules/colab/main/status/publish.tsx b/src/app_modules/colab/main/status/publish.tsx deleted file mode 100644 index 13ef3d23..00000000 --- a/src/app_modules/colab/main/status/publish.tsx +++ /dev/null @@ -1,41 +0,0 @@ -"use client"; - -import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/_global/author_name_on_header"; -import { Card, Stack, Grid, Text, Divider, Center, Box } from "@mantine/core"; -import ComponentColab_CardSectionData from "../../component/card_view/card_section_data"; -import ComponentColab_AuthorNameOnHeader from "../../component/header_author_name"; -import ComponentColab_CardSectionHeaderAuthorName from "../../component/card_view/card_section_header_author_name"; -import { RouterColab } from "@/app/lib/router_hipmi/router_colab"; -import ComponentColab_JumlahPartisipan from "../../component/card_view/card_section_jumlah_partisipan"; -import { MODEL_COLLABORATION } from "../../model/interface"; - -export default function Colab_StatusPublish({ - listPublish, -}: { - listPublish: MODEL_COLLABORATION[]; -}) { - return ( - <> - {listPublish.map((e, i) => ( - - - - - - - ))} - - ); -} diff --git a/src/app_modules/colab/main/status/reject.tsx b/src/app_modules/colab/main/status/reject.tsx deleted file mode 100644 index 049979a3..00000000 --- a/src/app_modules/colab/main/status/reject.tsx +++ /dev/null @@ -1,31 +0,0 @@ -"use client"; - -import { Card } from "@mantine/core"; -import ComponentColab_CardSectionData from "../../component/card_view/card_section_data"; -import { RouterColab } from "@/app/lib/router_hipmi/router_colab"; - -export default function Colab_StatusReject() { - return ( - <> - {Array(5) - .fill(0) - .map((e, i) => ( - - - - ))} - - ); -} diff --git a/src/app_modules/colab/main/status/review.tsx b/src/app_modules/colab/main/status/review.tsx deleted file mode 100644 index e3e48053..00000000 --- a/src/app_modules/colab/main/status/review.tsx +++ /dev/null @@ -1,27 +0,0 @@ -"use client"; - -import { Card } from "@mantine/core"; -import ComponentColab_CardSectionData from "../../component/card_view/card_section_data"; -import { RouterColab } from "@/app/lib/router_hipmi/router_colab"; - -export default function Colab_StatusReview() { - return ( - <> - {Array(5) - .fill(0) - .map((e, i) => ( - - - - ))} - - ); -} diff --git a/src/app_modules/job/_ui/index.ts b/src/app_modules/job/_ui/index.ts new file mode 100644 index 00000000..f7088635 --- /dev/null +++ b/src/app_modules/job/_ui/index.ts @@ -0,0 +1,3 @@ +import { Job_UiNotUserView } from "./ui_not_user_view_job"; + +export { Job_UiNotUserView }; diff --git a/src/app_modules/job/_ui/ui_not_user_view_job.tsx b/src/app_modules/job/_ui/ui_not_user_view_job.tsx new file mode 100644 index 00000000..f7435e4e --- /dev/null +++ b/src/app_modules/job/_ui/ui_not_user_view_job.tsx @@ -0,0 +1,21 @@ +"use client"; + +import { + UIGlobal_LayoutHeaderTamplate, + UIGlobal_LayoutTamplate, +} from "@/app_modules/_global/ui"; +import { Job_ViewNotUserJobVacany } from "../_view"; + +export function Job_UiNotUserView({ data }: { data: any }) { + return ( + <> + + } + > + + + + ); +} diff --git a/src/app_modules/job/_view/index.ts b/src/app_modules/job/_view/index.ts new file mode 100644 index 00000000..2349b992 --- /dev/null +++ b/src/app_modules/job/_view/index.ts @@ -0,0 +1,3 @@ +import { Job_ViewNotUserJobVacany } from "./view_not_user_view_job"; + +export { Job_ViewNotUserJobVacany }; diff --git a/src/app_modules/job/_view/view_not_user_view_job.tsx b/src/app_modules/job/_view/view_not_user_view_job.tsx new file mode 100644 index 00000000..75908f27 --- /dev/null +++ b/src/app_modules/job/_view/view_not_user_view_job.tsx @@ -0,0 +1,45 @@ +import { + ComponentGlobal_CardStyles, + ComponentGlobal_NotUserLoadImage, +} from "@/app_modules/_global/component"; +import { Center, Stack, Text, Title } from "@mantine/core"; + +export function Job_ViewNotUserJobVacany({ data }: { data: any }) { + return ( + <> + {data ? ( + + + {data.imageId && ( + + )} + + +
+ + {data.title} + +
+ + +
+ + +
+ + + + + + ) : ( + + + + Data Not Found + + + + )} + + ); +} diff --git a/src/app_modules/job/component/beranda/card_view.tsx b/src/app_modules/job/component/beranda/card_view.tsx index f134e4a9..1b74a517 100644 --- a/src/app_modules/job/component/beranda/card_view.tsx +++ b/src/app_modules/job/component/beranda/card_view.tsx @@ -1,16 +1,15 @@ "use client"; import { RouterJob } from "@/app/lib/router_hipmi/router_job"; -import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/_global/author_name_on_header"; import { - MainColor, - AccentColor, -} from "@/app_modules/_global/color/color_pallet"; -import { ComponentGlobal_CardLoadingOverlay } from "@/app_modules/_global/component"; -import { Card, Grid, Center, Text } from "@mantine/core"; -import { MODEL_JOB } from "../../model/interface"; + ComponentGlobal_AvatarAndUsername, + ComponentGlobal_CardLoadingOverlay, + ComponentGlobal_CardStyles, +} from "@/app_modules/_global/component"; +import { Center, Stack, Text } from "@mantine/core"; import { useRouter } from "next/navigation"; import { useState } from "react"; +import { MODEL_JOB } from "../../model/interface"; export default function ComponentJob_BerandaCardView({ data, @@ -19,52 +18,29 @@ export default function ComponentJob_BerandaCardView({ }) { const router = useRouter(); const [visible, setVisible] = useState(false); - const [jobId, setJobId] = useState(""); return ( <> - - - + + - - { - visible ? "" : setJobId(data.id), - setVisible(true), - router.push(RouterJob.main_detail + data.id); - }} - mt={"lg"} - > - - -
- - {data.title} - -
-
-
-
- {visible && data.id === jobId ? ( - - ) : ( - "" - )} -
+ +
{ + setVisible(true), router.push(RouterJob.main_detail + data.id); + }} + > + + {data.title} + +
+ + {visible && } + + ); } diff --git a/src/app_modules/job/component/detail/comp_detail_data_not_user.tsx b/src/app_modules/job/component/detail/comp_detail_data_not_user.tsx new file mode 100644 index 00000000..ff1cfd76 --- /dev/null +++ b/src/app_modules/job/component/detail/comp_detail_data_not_user.tsx @@ -0,0 +1,61 @@ +"use client"; + +import { + ComponentGlobal_CardStyles, + ComponentGlobal_LoadImage, + ComponentGlobal_NotUserLoadImage, +} from "@/app_modules/_global/component"; +import { + Card, + Center, + Image, + Skeleton, + Stack, + Text, + Title, +} from "@mantine/core"; +import { MODEL_JOB } from "../../model/interface"; + +export default function ComponentJob_NotUserDetailData({ + data, +}: { + data?: MODEL_JOB; +}) { + return ( + <> + {data ? ( + + + {data.imageId && ( + + )} + + +
+ + {data.title} + +
+ + +
+ + +
+ + + + + + ) : ( + + + + Data Not Found + + + + )} + + ); +} diff --git a/src/app_modules/job/component/detail/detail_data.tsx b/src/app_modules/job/component/detail/detail_data.tsx index 3fb3c9d1..07ba01f7 100644 --- a/src/app_modules/job/component/detail/detail_data.tsx +++ b/src/app_modules/job/component/detail/detail_data.tsx @@ -1,17 +1,17 @@ "use client"; import { - AccentColor, - MainColor, -} from "@/app_modules/_global/color/color_pallet"; -import { ComponentGlobal_LoadImage } from "@/app_modules/_global/component"; + ComponentGlobal_CardStyles, + ComponentGlobal_LoadImage, +} from "@/app_modules/_global/component"; import { Card, Center, Image, Skeleton, Stack, - Text + Text, + Title, } from "@mantine/core"; import { MODEL_JOB } from "../../model/interface"; @@ -20,85 +20,40 @@ export default function ComponentJob_DetailData({ }: { data?: MODEL_JOB; }) { - return ( <> - {/*
{JSON.stringify(data, null, 2)}
*/} - {data ? ( - - - - {data.imageId && ( - - )} + + + {data.imageId && ( + + )} - -
- - {data.title} - -
- - -
- - -
- - - - - - - ) : ( - - - - - + +
- Judul Lowongan Kerja + {data.title} - - - - - Syarat & Ketentuan : +
+ + +
- - {Array(5) - .fill(0) - .map((e, i) => ( - - ))} - - - - - - Deskripsi + +
- - {Array(5) - .fill(0) - .map((e, i) => ( - - ))} - - - + + + ) : ( + + + + Data Not Found + + + )} ); diff --git a/src/app_modules/job/detail/main/view.tsx b/src/app_modules/job/detail/main/view.tsx index f492f9c2..c159fc61 100644 --- a/src/app_modules/job/detail/main/view.tsx +++ b/src/app_modules/job/detail/main/view.tsx @@ -1,37 +1,40 @@ "use client"; +import { RouterJob } from "@/app/lib/router_hipmi/router_job"; import { Button, Center, Stack } from "@mantine/core"; +import { useShallowEffect } from "@mantine/hooks"; import { IconBrandWhatsapp } from "@tabler/icons-react"; import Link from "next/link"; -import { useRouter } from "next/navigation"; +import { useState } from "react"; import ComponentJob_DetailData from "../../component/detail/detail_data"; import { MODEL_JOB } from "../../model/interface"; -export default function Job_MainDetail({ - dataJob, - hostName, -}: { - dataJob: MODEL_JOB; - hostName: string; -}) { +export default function Job_MainDetail({ dataJob }: { dataJob: MODEL_JOB }) { return ( <> - + ); } -function ButtonAction({ - jobId, - hostName, -}: { - jobId: string; - hostName: string; -}) { - const router = useRouter(); +function ButtonAction({ jobId }: { jobId: string }) { + const [origin, setOrigin] = useState(""); + + useShallowEffect(() => { + onLoadOrigin(setOrigin); + // if (typeof window !== "undefined") { + // setOrigin(window.location.origin); + // } + }, [setOrigin]); + + async function onLoadOrigin(setOrigin: any) { + const res = await fetch("/api/zz-makuro"); + const result = await res.json(); + setOrigin(result.origin); + } return ( <> @@ -44,8 +47,7 @@ function ButtonAction({ > Bagikan ke WhatsApp diff --git a/src/app_modules/job/main/beranda/ui_beranda.tsx b/src/app_modules/job/main/beranda/ui_beranda.tsx index c4ec4dbd..f4e93da8 100644 --- a/src/app_modules/job/main/beranda/ui_beranda.tsx +++ b/src/app_modules/job/main/beranda/ui_beranda.tsx @@ -45,7 +45,7 @@ export function Job_UiBeranda({ listData }: { listData: MODEL_JOB[] }) { setData(val); }, }); - + mqtt_client.subscribe("Job_new_post"); mqtt_client.on("message", (topic, message) => { if (topic === "Job_new_post") { diff --git a/src/app_modules/job/non_user_view/layout.tsx b/src/app_modules/job/non_user_view/layout.tsx index f87c718b..787a9983 100644 --- a/src/app_modules/job/non_user_view/layout.tsx +++ b/src/app_modules/job/non_user_view/layout.tsx @@ -1,11 +1,8 @@ "use client"; -import { AppShell, Center } from "@mantine/core"; -import React from "react"; -import ComponentJob_HeaderTamplate from "../component/header_tamplate"; -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 UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate"; +import React from "react"; export default function LayoutJob_NonUserView({ children, @@ -15,7 +12,7 @@ export default function LayoutJob_NonUserView({ return ( <> } + header={} > {children} diff --git a/src/app_modules/job/non_user_view/view.tsx b/src/app_modules/job/non_user_view/view.tsx index 3df58f7c..a0d678fa 100644 --- a/src/app_modules/job/non_user_view/view.tsx +++ b/src/app_modules/job/non_user_view/view.tsx @@ -1,84 +1,12 @@ "use client"; -import { - Card, - Center, - Image, - Overlay, - Stack, - Text, - Title, -} from "@mantine/core"; import ComponentJob_DetailData from "../component/detail/detail_data"; -import { RouterJob } from "@/app/lib/router_hipmi/router_job"; -import { data } from "autoprefixer"; import { MODEL_JOB } from "../model/interface"; -import { - AccentColor, - MainColor, -} from "@/app_modules/_global/color/color_pallet"; -import { APIs } from "@/app/lib"; export default function Job_NonUserView({ data }: { data: MODEL_JOB }) { return ( <> -
- - - - {data.imageId ? ( - - - - ) : ( - "" - )} - - -
- - {data.title} - -
- - -
- - -
- - - - - - {data?.isArsip === true && ( - - - - Mohon Maaf ! - - - Lowongan Kerja Ini Sudah Ditutup{" "} - - - - )} - -
+ ); } diff --git a/src/app_modules/katalog/portofolio/ui/ui_detail_portofolio.tsx b/src/app_modules/katalog/portofolio/ui/ui_detail_portofolio.tsx index 71167791..fbaee7a5 100644 --- a/src/app_modules/katalog/portofolio/ui/ui_detail_portofolio.tsx +++ b/src/app_modules/katalog/portofolio/ui/ui_detail_portofolio.tsx @@ -4,9 +4,8 @@ import { Stack } from "@mantine/core"; import { ComponentPortofolio_ButtonDelete } from "../component/button_delete"; import { MODEL_PORTOFOLIO } from "../model/interface"; import { Portofolio_UiDetailData } from "./ui_detail_data"; -import { Portofolio_UiDetailLogo } from "./ui_detail_logo"; -import { Portofolio_UiSosialMedia } from "./ui_detail_media"; import { Portofolio_UiMap } from "./ui_detail_map"; +import { Portofolio_UiSosialMedia } from "./ui_detail_media"; export default function Portofolio_UiDetail({ dataPorto, diff --git a/src/app_modules/user_search/component/ui_user_search.tsx b/src/app_modules/user_search/component/ui_user_search.tsx index 54b2f9c4..cdefcc7c 100644 --- a/src/app_modules/user_search/component/ui_user_search.tsx +++ b/src/app_modules/user_search/component/ui_user_search.tsx @@ -1,14 +1,15 @@ "use client"; import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog"; +import { ComponentGlobal_LoaderAvatar } from "@/app_modules/_global/component"; import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data"; import ComponentGlobal_Loader from "@/app_modules/_global/component/loader"; import { MODEL_USER } from "@/app_modules/home/model/interface"; import { ActionIcon, - Avatar, Box, Center, + Grid, Group, Loader, Stack, @@ -21,7 +22,6 @@ import { ScrollOnly } from "next-scroll-loader"; import { useRouter } from "next/navigation"; import { useState } from "react"; import { userSearch_getAllUser } from "../fun/get/get_all_user"; -import { ComponentGlobal_LoaderAvatar } from "@/app_modules/_global/component"; export function UserSearch_UiView({ listUser }: { listUser: MODEL_USER[] }) { const [data, setData] = useState(listUser); @@ -45,12 +45,12 @@ export function UserSearch_UiView({ listUser }: { listUser: MODEL_USER[] }) { radius={"xl"} style={{ zIndex: 99 }} icon={} - placeholder="Masukan username " + placeholder="Masukan nama pengguna " onChange={(val) => onSearch(val.target.value)} /> {_.isEmpty(data) ? ( - + ) : ( - {/*
{JSON.stringify(data, null, 2)}
*/} ); } @@ -87,7 +86,47 @@ function CardView({ data }: { data: MODEL_USER }) { return ( <> - { + setLoading(true); + router.push(RouterProfile.katalog({ id: data.Profile.id })); + }} + > + + + + + + + + + {data?.Profile.name} + + + +{data?.nomor} + + + + + +
+ + {loading ? ( + + ) : ( + + )} + +
+
+
+ + + {/* - - + + + - {data?.username} + {data?.Profile.name}d sdasd sdas +{data?.nomor} @@ -125,7 +165,7 @@ function CardView({ data }: { data: MODEL_USER }) { - +
*/} ); } diff --git a/src/app_modules/user_search/fun/get/get_all_user.ts b/src/app_modules/user_search/fun/get/get_all_user.ts index fbdb3b22..7b019a9a 100644 --- a/src/app_modules/user_search/fun/get/get_all_user.ts +++ b/src/app_modules/user_search/fun/get/get_all_user.ts @@ -24,10 +24,13 @@ export async function userSearch_getAllUser({ where: { active: true, masterUserRoleId: "1", - username: { - contains: search, - mode: "insensitive", + Profile: { + name: { + contains: search, + mode: "insensitive", + }, }, + NOT: { Profile: null, }, diff --git a/src/app_modules/vote/_view/view_detail_kontributor_voting.tsx b/src/app_modules/vote/_view/view_detail_kontributor_voting.tsx index 26aa8e10..d833ebb6 100644 --- a/src/app_modules/vote/_view/view_detail_kontributor_voting.tsx +++ b/src/app_modules/vote/_view/view_detail_kontributor_voting.tsx @@ -1,20 +1,10 @@ -import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog"; -import { AccentColor } from "@/app_modules/_global/color"; -import { ComponentGlobal_AvatarAndAuthorName } from "@/app_modules/_global/component"; -import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data"; import { - Card, - Stack, - Center, - Title, - Grid, - Avatar, - Badge, - Divider, - Text, -} from "@mantine/core"; + ComponentGlobal_AvatarAndUsername, + ComponentGlobal_CardStyles, +} from "@/app_modules/_global/component"; +import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data"; +import { Badge, Group, Stack, Text } from "@mantine/core"; import _ from "lodash"; -import router from "next/router"; import { MODEL_VOTE_KONTRIBUTOR } from "../model/interface"; export function Voting_ViewDetailKontributorVoting({ @@ -24,40 +14,32 @@ export function Voting_ViewDetailKontributorVoting({ }) { return ( <> - - - {_.isEmpty(listKontributor) ? ( - - ) : ( - - {listKontributor?.map((e, i) => ( - + {_.isEmpty(listKontributor) ? ( + + ) : ( + + {listKontributor?.map((e, i) => ( + 10 ? 8 : 10} > {e.Voting_DaftarNamaVote.value} - } - /> - ))} - - )} - - + + } + /> + ))} + + )} + ); } diff --git a/src/app_modules/vote/component/card_view_publish.tsx b/src/app_modules/vote/component/card_view_publish.tsx index f2c2b949..3f033f39 100644 --- a/src/app_modules/vote/component/card_view_publish.tsx +++ b/src/app_modules/vote/component/card_view_publish.tsx @@ -23,7 +23,11 @@ import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/noti import { AccentColor } from "@/app_modules/_global/color/color_pallet"; import { toNumber } from "lodash"; import { useState } from "react"; -import { ComponentGlobal_CardLoadingOverlay } from "@/app_modules/_global/component"; +import { + ComponentGlobal_AvatarAndUsername, + ComponentGlobal_CardLoadingOverlay, + ComponentGlobal_CardStyles, +} from "@/app_modules/_global/component"; export default function ComponentVote_CardViewPublish({ data, @@ -45,140 +49,125 @@ export default function ComponentVote_CardViewPublish({ return ( <> - - {/* Header name */} - {authorName ? ( - - + + {/* Header name */} + {authorName ? ( + - - ) : ( - "" - )} + ) : ( + "" + )} - {/* Isi deskripsi */} - { - if (data?.id === undefined) { - ComponentGlobal_NotifikasiPeringatan("Halaman tidak ditemukan"); - } else { - setVisible(true); - router.push(path + data?.id); - } - }} - > - - - - {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"} - - - + {/* Isi deskripsi */} + { + if (data?.id === undefined) { + ComponentGlobal_NotifikasiPeringatan("Halaman tidak ditemukan"); + } else { + setVisible(true); + router.push(path + data?.id); + } + }} + > + + + + {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 ? ( + +
+ Hasil Voting +
+ + + {data?.Voting_DaftarNamaVote.map((e) => ( + = 4 ? 6 : 4} + > + + + {e.jumlah} + + + {e.value} + + + + ))} + +
+ ) : ( + "" + )}
- {data ? ( - -
- Hasil Voting -
- - {data?.Voting_DaftarNamaVote.map((e) => ( - = 4 ? 6 : 4} - > - - - {e.jumlah} - - - {e.value} - - - - ))} - + {pilihanSaya ? ( + + + Pilihan anda: + + + + {namaPilihan} + + ) : ( "" )} -
- {pilihanSaya ? ( - - - Pilihan anda: - - - - {namaPilihan} - - - - ) : ( - "" - )} + {statusArsip ? ( +
+ + {data?.isArsip ? "Arsip" : "Publish"} + +
+ ) : ( + "" + )} - {statusArsip ? ( -
- - {data?.isArsip ? "Arsip" : "Publish"} - -
- ) : ( - "" - )} - - {visible && } -
-
+ {visible && } +
+ + ); } diff --git a/src/app_modules/vote/component/detail/comp_layout_header_detail_publish.tsx b/src/app_modules/vote/component/detail/comp_layout_header_detail_publish.tsx index 95de8240..2024bb93 100644 --- a/src/app_modules/vote/component/detail/comp_layout_header_detail_publish.tsx +++ b/src/app_modules/vote/component/detail/comp_layout_header_detail_publish.tsx @@ -1,8 +1,9 @@ import { RouterVote } from "@/app/lib/router_hipmi/router_vote"; import { AccentColor } from "@/app_modules/_global/color"; import ComponentGlobal_Loader from "@/app_modules/_global/component/loader"; +import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil"; +import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal"; import { UIGlobal_Modal } from "@/app_modules/_global/ui"; -import UIGlobal_Drawer from "@/app_modules/_global/ui/ui_drawer"; import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate"; import { ActionIcon, @@ -13,47 +14,48 @@ import { Stack, Text, } from "@mantine/core"; -import { IconArchive, IconUsersGroup, IconX } from "@tabler/icons-react"; -import { IconDots, IconDotsVertical } from "@tabler/icons-react"; +import { + IconArchive, + IconDotsVertical, + IconUsersGroup, + IconX, +} from "@tabler/icons-react"; import { useRouter } from "next/navigation"; import { useState } from "react"; -import { voting_funGetOneVotingbyId } from "../../fun/get/fun_get_one_by_id"; -import { useShallowEffect } from "@mantine/hooks"; -import { MODEL_VOTING } from "../../model/interface"; import { voting_funUpdateIsArsipById } from "../../fun"; -import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil"; -import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal"; +import { MODEL_VOTING } from "../../model/interface"; +import { voting_funGetOneVotingbyId } from "../../fun/get/fun_get_one_by_id"; export function Voting_ComponentLayoutHeaderDetailPublish({ votingId, title, userLoginId, + dataVoting, }: { votingId: string; title: string; userLoginId: string; + dataVoting: any; }) { - const [data, setData] = useState(); + const [data, setData] = useState(dataVoting); const [openDrawer, setOpenDrawer] = useState(false); const [openModal, setOpenModal] = useState(false); - useShallowEffect(() => { - onLoadData({ onSetData: setData }); - }, [setData]); - - async function onLoadData({ onSetData }: { onSetData: any }) { - const dataVoting = await voting_funGetOneVotingbyId(votingId); - onSetData(dataVoting); - } - async function onUpdateStatusArsip({ isArsip }: { isArsip: boolean }) { const res = await voting_funUpdateIsArsipById({ votingId, isArsip: isArsip, }); if (res.status === 200) { - setOpenModal(false); - ComponentGlobal_NotifikasiBerhasil(res.message); + try { + const loadData = await voting_funGetOneVotingbyId(votingId); + setData(loadData as any); + } catch (error) { + console.log(error); + } finally { + setOpenModal(false); + ComponentGlobal_NotifikasiBerhasil(res.message); + } } else { ComponentGlobal_NotifikasiGagal(res.message); } 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 92da150c..5fe9cd07 100644 --- a/src/app_modules/vote/component/detail/detail_daftar_kontributor.tsx +++ b/src/app_modules/vote/component/detail/detail_daftar_kontributor.tsx @@ -1,21 +1,21 @@ "use client"; -import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog"; -import { AccentColor } from "@/app_modules/_global/color/color_pallet"; import { - Avatar, + ComponentGlobal_AvatarAndUsername, + ComponentGlobal_CardStyles, +} from "@/app_modules/_global/component"; +import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data"; +import { Badge, - Card, + Box, Center, - Divider, - Grid, + Group, Stack, Text, - Title, + Title } from "@mantine/core"; import _ from "lodash"; import { useRouter } from "next/navigation"; import { MODEL_VOTE_KONTRIBUTOR } from "../../model/interface"; -import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data"; export default function ComponentVote_DaftarKontributorVoter({ listKontributor, @@ -25,63 +25,29 @@ export default function ComponentVote_DaftarKontributorVoter({ const router = useRouter(); return ( <> - - - -
- Daftar Kontributor -
+ + +
+ Daftar Kontributor +
- {_.isEmpty(listKontributor) ? ( - - ) : ( - - {listKontributor?.map((e, i) => ( - - - - router.push( - RouterProfile.katalogOLD + e.Author.Profile.id - ) - } - > - - - - - - {e ? e.Author.Profile.name : "Nama author"} - - - - + {_.isEmpty(listKontributor) ? ( + + ) : ( + + {listKontributor?.map((e, i) => ( + + 10 ? 8 : 10 } @@ -89,16 +55,15 @@ export default function ComponentVote_DaftarKontributorVoter({ {e.Voting_DaftarNamaVote.value} - - - - - ))} - - )} -
-
-
+ + } + /> + + ))} + + )} + + ); } 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 949de897..a78d5d47 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 @@ -1,21 +1,11 @@ "use client"; -import { - Card, - Stack, - Center, - Title, - Badge, - Group, - Radio, - Grid, - Text, -} from "@mantine/core"; -import moment from "moment"; -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"; +import { + ComponentGlobal_AvatarAndUsername, + ComponentGlobal_CardStyles, +} from "@/app_modules/_global/component"; +import { Badge, Center, Group, Stack, Text, Title } from "@mantine/core"; +import { MODEL_VOTING } from "../../model/interface"; export default function ComponentVote_DetailDataSetelahPublish({ data, @@ -26,27 +16,15 @@ export default function ComponentVote_DetailDataSetelahPublish({ }) { return ( <> - - {authorName ? ( - - + + {authorName ? ( + - - ) : ( - "" - )} - + ) : ( + "" + )}
@@ -87,8 +65,8 @@ export default function ComponentVote_DetailDataSetelahPublish({ </Stack> </Stack> </Stack> - </Card.Section> - </Card> + </Stack> + </ComponentGlobal_CardStyles> </> ); } diff --git a/src/app_modules/vote/detail/kontribusi/index.tsx b/src/app_modules/vote/detail/kontribusi/index.tsx index 829c32c5..037d7abb 100644 --- a/src/app_modules/vote/detail/kontribusi/index.tsx +++ b/src/app_modules/vote/detail/kontribusi/index.tsx @@ -1,21 +1,11 @@ "use client"; import { - Badge, - Card, - Center, - Grid, - Group, - Radio, - Stack, - Text, - Title, + Stack } from "@mantine/core"; -import moment from "moment"; -import ComponentVote_HasilVoting from "../../component/detail/detail_hasil_voting"; -import ComponentVote_DaftarKontributorVoter from "../../component/detail/detail_daftar_kontributor"; -import { MODEL_VOTING } from "../../model/interface"; import ComponentVote_DetailDataSetelahPublish from "../../component/detail/detail_data_setelah_publish"; +import ComponentVote_HasilVoting from "../../component/detail/detail_hasil_voting"; +import { MODEL_VOTING } from "../../model/interface"; export default function Vote_DetailKontribusi({ dataVote, diff --git a/src/app_modules/vote/detail/kontribusi/layout.tsx b/src/app_modules/vote/detail/kontribusi/layout.tsx index dffb67c8..91beef23 100644 --- a/src/app_modules/vote/detail/kontribusi/layout.tsx +++ b/src/app_modules/vote/detail/kontribusi/layout.tsx @@ -8,16 +8,19 @@ export default function LayoutVote_DetailKontribusi({ children, votingId, userLoginId, + dataVoting }: { children: React.ReactNode; votingId: string; userLoginId: string; + dataVoting: any }) { return ( <> <UIGlobal_LayoutTamplate header={ <Voting_ComponentLayoutHeaderDetailPublish + dataVoting={dataVoting} title="Detail Kontribusi" userLoginId={userLoginId} votingId={votingId} diff --git a/src/app_modules/vote/detail/main/index.tsx b/src/app_modules/vote/detail/main/index.tsx index faeae78d..ee413d6e 100644 --- a/src/app_modules/vote/detail/main/index.tsx +++ b/src/app_modules/vote/detail/main/index.tsx @@ -5,9 +5,11 @@ import { AccentColor, MainColor, } from "@/app_modules/_global/color/color_pallet"; +import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information"; import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil"; import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan"; import notifikasiToUser_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_user"; +import mqtt_client from "@/util/mqtt_client"; import { Badge, Box, @@ -21,15 +23,14 @@ import { Title, } from "@mantine/core"; import _ from "lodash"; +import moment from "moment"; import { useState } from "react"; -import ComponentVote_DaftarKontributorVoter from "../../component/detail/detail_daftar_kontributor"; import ComponentVote_HasilVoting from "../../component/detail/detail_hasil_voting"; import { Vote_funCreateHasil } from "../../fun/create/create_hasil"; import { voting_funGetOneVotingbyId } from "../../fun/get/fun_get_one_by_id"; import { MODEL_VOTING } from "../../model/interface"; -import mqtt_client from "@/util/mqtt_client"; -import moment from "moment"; -import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information"; +import { ComponentDonasi_CardStatus } from "@/app_modules/donasi/component/card_view/card_status"; +import { ComponentGlobal_AvatarAndUsername, ComponentGlobal_CardStyles } from "@/app_modules/_global/component"; export default function Vote_MainDetail({ dataVote, @@ -51,7 +52,7 @@ export default function Vote_MainDetail({ return ( <> - <Stack py={"md"}> + <Stack pb={"md"}> {moment(dataVote?.awalVote).diff(today, "hours") < 0 ? ( "" ) : ( @@ -88,23 +89,14 @@ function TampilanDataVoting({ return ( <> - <Card - p={30} - style={{ - backgroundColor: AccentColor.darkblue, - borderRadius: "10px", - border: `2px solid ${AccentColor.blue}`, - color: "white", - }} - > - <Card.Section mb={"md"}> - <ComponentGlobal_AuthorNameOnHeader + <ComponentGlobal_CardStyles> + <Stack> + <ComponentGlobal_AvatarAndUsername profile={dataVote?.Author?.Profile as any}/> + {/* <ComponentGlobal_AuthorNameOnHeader authorName={dataVote?.Author.Profile.name} imagesId={dataVote?.Author.Profile.imagesId} profileId={dataVote?.Author.Profile.id} - /> - </Card.Section> - <Card.Section px={"xs"} py={"sm"}> + /> */} <Stack spacing={"lg"}> <Center> <Title order={5} align="center"> @@ -146,10 +138,6 @@ function TampilanDataVoting({ </Stack> </Stack> </Stack> - </Card.Section> - - {/* Voting View */} - <Card.Section py={"xl"}> {isKontributor ? ( <Stack align="center" @@ -232,8 +220,9 @@ function TampilanDataVoting({ </Center> </Stack> )} - </Card.Section> - </Card> + </Stack> + + </ComponentGlobal_CardStyles> </> ); } diff --git a/src/app_modules/vote/detail/main/layout.tsx b/src/app_modules/vote/detail/main/layout.tsx index 4133cd11..bc8fbae3 100644 --- a/src/app_modules/vote/detail/main/layout.tsx +++ b/src/app_modules/vote/detail/main/layout.tsx @@ -8,10 +8,12 @@ export default function LayoutVote_MainDetail({ children, votingId, userLoginId, + dataVoting, }: { children: React.ReactNode; votingId: string; userLoginId: string; + dataVoting: any }) { return ( <> @@ -21,6 +23,7 @@ export default function LayoutVote_MainDetail({ title="Detail Voting" votingId={votingId} userLoginId={userLoginId} + dataVoting={dataVoting} /> } > diff --git a/src/app_modules/vote/detail/publish/index.tsx b/src/app_modules/vote/detail/publish/index.tsx index 28775024..d44049f7 100644 --- a/src/app_modules/vote/detail/publish/index.tsx +++ b/src/app_modules/vote/detail/publish/index.tsx @@ -1,10 +1,9 @@ "use client"; import { Badge, Center, Stack } from "@mantine/core"; -import ComponentVote_DaftarKontributorVoter from "../../component/detail/detail_daftar_kontributor"; import ComponentVote_DetailDataSetelahPublish from "../../component/detail/detail_data_setelah_publish"; import ComponentVote_HasilVoting from "../../component/detail/detail_hasil_voting"; -import { MODEL_VOTE_KONTRIBUTOR, MODEL_VOTING } from "../../model/interface"; +import { MODEL_VOTING } from "../../model/interface"; export default function Vote_DetailPublish({ dataVote, diff --git a/src/app_modules/vote/detail/publish/layout.tsx b/src/app_modules/vote/detail/publish/layout.tsx index 467efe59..ba311579 100644 --- a/src/app_modules/vote/detail/publish/layout.tsx +++ b/src/app_modules/vote/detail/publish/layout.tsx @@ -9,16 +9,19 @@ export default function LayoutVote_DetailPublish({ children, votingId, userLoginId, + dataVoting, }: { children: React.ReactNode; votingId: string; userLoginId: string; + dataVoting: any; }) { return ( <> <UIGlobal_LayoutTamplate header={ <Voting_ComponentLayoutHeaderDetailPublish + dataVoting={dataVoting} title="Detail Publish" votingId={votingId} userLoginId={userLoginId} diff --git a/src/app_modules/vote/detail/riwayat_saya/index.tsx b/src/app_modules/vote/detail/riwayat_saya/index.tsx index b5c5ec86..c130f3e4 100644 --- a/src/app_modules/vote/detail/riwayat_saya/index.tsx +++ b/src/app_modules/vote/detail/riwayat_saya/index.tsx @@ -15,7 +15,7 @@ export default function Vote_DetailRiwayatSaya({ }) { return ( <> - <Stack py={"md"}> + <Stack pb={"md"}> <ComponentVote_DetailDataSetelahPublish data={dataVote} authorName={true} diff --git a/src/app_modules/vote/detail/semua_riwayat/index.tsx b/src/app_modules/vote/detail/semua_riwayat/index.tsx index 06cb5091..929d94aa 100644 --- a/src/app_modules/vote/detail/semua_riwayat/index.tsx +++ b/src/app_modules/vote/detail/semua_riwayat/index.tsx @@ -16,7 +16,7 @@ export default function Vote_DetailSemuaRiwayat({ }) { return ( <> - <Stack py={"md"}> + <Stack pb={"md"}> <ComponentVote_DetailDataSetelahPublish data={dataVote} authorName={true} diff --git a/src/app_modules/vote/fun/get/get_list_kontribusi_by_author_id.ts b/src/app_modules/vote/fun/get/get_list_kontribusi_by_author_id.ts index be51501d..237b5bf0 100644 --- a/src/app_modules/vote/fun/get/get_list_kontribusi_by_author_id.ts +++ b/src/app_modules/vote/fun/get/get_list_kontribusi_by_author_id.ts @@ -16,7 +16,7 @@ export async function vote_getAllListKontribusiByAuthorId({ take: takeData, skip: skipData, orderBy: { - createdAt: "asc", + createdAt: "desc", }, where: { authorId: userLoginId, diff --git a/src/app_modules/vote/fun/get/get_list_kontributor_by_id.ts b/src/app_modules/vote/fun/get/get_list_kontributor_by_id.ts index 6cb403e8..13d4695b 100644 --- a/src/app_modules/vote/fun/get/get_list_kontributor_by_id.ts +++ b/src/app_modules/vote/fun/get/get_list_kontributor_by_id.ts @@ -4,6 +4,9 @@ import prisma from "@/app/lib/prisma"; export async function Vote_getListKontributorById(votingId: string) { const data = await prisma.voting_Kontributor.findMany({ + orderBy:{ + createdAt: "desc" + }, where: { votingId: votingId, }, diff --git a/src/util/mqtt_loader.tsx b/src/util/mqtt_loader.tsx index 73404600..7fec82da 100644 --- a/src/util/mqtt_loader.tsx +++ b/src/util/mqtt_loader.tsx @@ -1,11 +1,7 @@ "use client"; -import { useEffect, useState } from "react"; +import { useEffect } from "react"; import mqtt_client from "./mqtt_client"; -import { useAtom } from "jotai"; -import { gs_coba_chat } from "@/app/makuro/gs_coba"; -import { evnPesan } from "./evn"; -import { Button, Stack } from "@mantine/core"; export default function MqttLoader() { useEffect(() => {