diff --git a/public/portofolio/logo/55409a1f-8d3d-455a-b5bf-10cd64eda28b.png b/public/portofolio/logo/55409a1f-8d3d-455a-b5bf-10cd64eda28b.png new file mode 100644 index 00000000..176da5a2 Binary files /dev/null and b/public/portofolio/logo/55409a1f-8d3d-455a-b5bf-10cd64eda28b.png differ diff --git a/public/portofolio/logo/a7ebdb61-1200-45b3-b868-ed9cc811c8b8.png b/public/portofolio/logo/a7ebdb61-1200-45b3-b868-ed9cc811c8b8.png new file mode 100644 index 00000000..256b64ba Binary files /dev/null and b/public/portofolio/logo/a7ebdb61-1200-45b3-b868-ed9cc811c8b8.png differ diff --git a/public/portofolio/logo/c457514a-9b0b-48b8-8ae6-2d903f8964bc.jpg b/public/portofolio/logo/c457514a-9b0b-48b8-8ae6-2d903f8964bc.jpg new file mode 100644 index 00000000..7184c41f Binary files /dev/null and b/public/portofolio/logo/c457514a-9b0b-48b8-8ae6-2d903f8964bc.jpg differ diff --git a/src/app/dev/home/layout.tsx b/src/app/dev/home/layout.tsx deleted file mode 100644 index 4e254330..00000000 --- a/src/app/dev/home/layout.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token"; -import { HomeLayout } from "@/app_modules/home"; -import { user_getOneByUserId } from "@/app_modules/home/fun/get/get_one_user_by_id"; -import notifikasi_countUserNotifikasi from "@/app_modules/notifikasi/fun/count/fun_count_by_id"; -import { redirect } from "next/navigation"; - -export default async function Layout({ children }: { children: any }) { - const userId = await user_getOneUserId(); - const dataUser = await user_getOneByUserId(userId); - - const countNotifikasi = await notifikasi_countUserNotifikasi(); - - return ( - <> - - {children} - - - ); -} diff --git a/src/app/dev/home/loading.tsx b/src/app/dev/home/loading.tsx deleted file mode 100644 index 623b464d..00000000 --- a/src/app/dev/home/loading.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2"; - -export default async function Page() { - return ( - <> - {/* */} - - ); -} diff --git a/src/app/dev/home/page.tsx b/src/app/dev/home/page.tsx index 3469f504..aa3e2356 100644 --- a/src/app/dev/home/page.tsx +++ b/src/app/dev/home/page.tsx @@ -4,6 +4,7 @@ import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token"; import { HomeView } from "@/app_modules/home"; import { user_getOneByUserId } from "@/app_modules/home/fun/get/get_one_user_by_id"; import { job_getTwoForHomeView } from "@/app_modules/job/fun/get/get_two_for_home_view"; +import notifikasi_countUserNotifikasi from "@/app_modules/notifikasi/fun/count/fun_count_by_id"; import { redirect } from "next/navigation"; export default async function Page() { @@ -24,9 +25,15 @@ export default async function Page() { // setTimeout(a, 3000); // }); + const countNotifikasi = await notifikasi_countUserNotifikasi(); + return ( <> - + ); } diff --git a/src/app/dev/katalog/[id]/layout.tsx b/src/app/dev/katalog/[id]/layout.tsx index 62c2dc48..82012dc7 100644 --- a/src/app/dev/katalog/[id]/layout.tsx +++ b/src/app/dev/katalog/[id]/layout.tsx @@ -1,10 +1,29 @@ +import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token"; import { KatalogLayout } from "@/app_modules/katalog/main"; +import { Profile_getOneProfileAndUserById } from "@/app_modules/katalog/profile/fun/get/get_one_user_profile"; + +export default async function Layout({ + children, + params, +}: { + children: any; + params: { id: string }; +}) { + const profileId = params.id; + const dataProfile = await Profile_getOneProfileAndUserById(profileId) + const authorId = dataProfile?.userId; + const userLoginId = await user_getOneUserId(); + -export default async function Layout({ children, params }: { children: any, params: {id: string} }) { - // const a = atob(params.id.toString()) return ( <> - {children} + + {children} + ); } diff --git a/src/app/dev/katalog/[id]/loading.tsx b/src/app/dev/katalog/[id]/loading.tsx deleted file mode 100644 index b1f8b62f..00000000 --- a/src/app/dev/katalog/[id]/loading.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2"; - -export default async function Page() { - return ( - <> - - - ); -} diff --git a/src/app/dev/katalog/[id]/page.tsx b/src/app/dev/katalog/[id]/page.tsx index f2ff9949..9116b1e1 100644 --- a/src/app/dev/katalog/[id]/page.tsx +++ b/src/app/dev/katalog/[id]/page.tsx @@ -1,37 +1,21 @@ -import prisma from "@/app/lib/prisma"; -import { KatalogView } from "@/app_modules/katalog/main"; -import { url } from "inspector"; -import { unsealData } from "iron-session"; -import _ from "lodash"; -import { cookies } from "next/headers"; -import { redirect } from "next/navigation"; -import { funGetUserProfile } from "@/app_modules/fun_global/get_user_profile"; -import yaml from "yaml"; -import fs from "fs"; -import { funGetListPortofolio } from "@/app_modules/katalog/portofolio/fun/get/get_list_portofolio"; import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token"; -import { Profile_getOneById } from "@/app_modules/katalog/profile/fun/get/get_one_profile"; +import { Katalog_MainView } from "@/app_modules/katalog"; +import { funGetListPortofolio } from "@/app_modules/katalog/portofolio/fun/get/get_list_portofolio"; import { Profile_getOneProfileAndUserById } from "@/app_modules/katalog/profile/fun/get/get_one_user_profile"; -import { user_getOneByUserId } from "@/app_modules/home/fun/get/get_one_user_by_id"; -const config = yaml.parse(fs.readFileSync("config.yaml").toString()); + export default async function Page({ params }: { params: { id: string } }) { let profileId = params.id; - const authorId = await user_getOneUserId(); - const dataUser = await user_getOneByUserId(authorId) + const userLoginId = await user_getOneUserId(); const listPorto = await funGetListPortofolio(profileId); const dataProfile = await Profile_getOneProfileAndUserById(profileId); - // await new Promise((a, b) => { - // setTimeout(a, 1000); - // }); - return ( <> - ); diff --git a/src/app/dev/notifikasi/page.tsx b/src/app/dev/notifikasi/page.tsx index 2ee83bdc..de986f62 100644 --- a/src/app/dev/notifikasi/page.tsx +++ b/src/app/dev/notifikasi/page.tsx @@ -1,9 +1,8 @@ import { Notifikasi_MainView } from "@/app_modules/notifikasi"; import notifikasi_getByUserId from "@/app_modules/notifikasi/fun/get/get_notifiaksi_by_id"; - export default async function Page() { - const listNotifikasi = await notifikasi_getByUserId() + const listNotifikasi = await notifikasi_getByUserId({ page: 1 }); return ( <> diff --git a/src/app/dev/portofolio/create/[id]/loading.tsx b/src/app/dev/portofolio/create/[id]/loading.tsx deleted file mode 100644 index b1f8b62f..00000000 --- a/src/app/dev/portofolio/create/[id]/loading.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2"; - -export default async function Page() { - return ( - <> - - - ); -} diff --git a/src/app/dev/portofolio/daftar-portofolio/[id]/page.tsx b/src/app/dev/portofolio/daftar-portofolio/[id]/page.tsx new file mode 100644 index 00000000..45a30f23 --- /dev/null +++ b/src/app/dev/portofolio/daftar-portofolio/[id]/page.tsx @@ -0,0 +1,17 @@ +import { Portofolio_ViewListDetail } from "@/app_modules/katalog/portofolio"; +import { portofolio_funGetAllDaftarByid } from "@/app_modules/katalog/portofolio/fun/get/get_all_portofolio"; + +export default async function Page({ params }: { params: { id: string } }) { + const profileId = params.id; + const dataPortofolio = await portofolio_funGetAllDaftarByid({ + profileId, + page: 1, + }); + + + return ( + <> + + + ); +} diff --git a/src/app/dev/portofolio/edit/data/[id]/loading.tsx b/src/app/dev/portofolio/edit/data/[id]/loading.tsx deleted file mode 100644 index b1f8b62f..00000000 --- a/src/app/dev/portofolio/edit/data/[id]/loading.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2"; - -export default async function Page() { - return ( - <> - - - ); -} diff --git a/src/app/dev/portofolio/edit/logo/[id]/loading.tsx b/src/app/dev/portofolio/edit/logo/[id]/loading.tsx deleted file mode 100644 index b1f8b62f..00000000 --- a/src/app/dev/portofolio/edit/logo/[id]/loading.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2"; - -export default async function Page() { - return ( - <> - - - ); -} diff --git a/src/app/dev/portofolio/edit/medsos/[id]/loading.tsx b/src/app/dev/portofolio/edit/medsos/[id]/loading.tsx deleted file mode 100644 index b1f8b62f..00000000 --- a/src/app/dev/portofolio/edit/medsos/[id]/loading.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2"; - -export default async function Page() { - return ( - <> - - - ); -} diff --git a/src/app/dev/portofolio/main/[id]/loading.tsx b/src/app/dev/portofolio/main/[id]/loading.tsx deleted file mode 100644 index b1f8b62f..00000000 --- a/src/app/dev/portofolio/main/[id]/loading.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2"; - -export default async function Page() { - return ( - <> - - - ); -} diff --git a/src/app/dev/portofolio/main/[id]/page.tsx b/src/app/dev/portofolio/main/[id]/page.tsx index 6e18a541..fe44019e 100644 --- a/src/app/dev/portofolio/main/[id]/page.tsx +++ b/src/app/dev/portofolio/main/[id]/page.tsx @@ -4,14 +4,15 @@ import { portofolio_getOneById } from "@/app_modules/katalog/portofolio/fun/get/ export default async function Page({ params }: { params: { id: string } }) { const getPorto = await portofolio_getOneById(params.id); - const userLoginId = await user_getOneUserId() - - + const userLoginId = await user_getOneUserId(); return ( <> {/* {JSON.stringify(getPorto)} */} - + ); } diff --git a/src/app/dev/profile/create/loading.tsx b/src/app/dev/profile/create/loading.tsx deleted file mode 100644 index b1f8b62f..00000000 --- a/src/app/dev/profile/create/loading.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2"; - -export default async function Page() { - return ( - <> - - - ); -} diff --git a/src/app/dev/profile/edit/[id]/loading.tsx b/src/app/dev/profile/edit/[id]/loading.tsx deleted file mode 100644 index b1f8b62f..00000000 --- a/src/app/dev/profile/edit/[id]/loading.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2"; - -export default async function Page() { - return ( - <> - - - ); -} diff --git a/src/app/dev/profile/upload/background/[id]/layout.tsx b/src/app/dev/profile/upload/background/[id]/layout.tsx index ff543f33..11f4cf1b 100644 --- a/src/app/dev/profile/upload/background/[id]/layout.tsx +++ b/src/app/dev/profile/upload/background/[id]/layout.tsx @@ -1,8 +1,16 @@ import LayoutProfile_UpdateFotoBackground from "@/app_modules/katalog/profile/upload/foto_background/layout"; import React from "react"; -export default async function Layout({children}: {children: React.ReactNode}) { - return<> - {children} +export default async function Layout({ + children, +}: { + children: React.ReactNode; +}) { + return ( + <> + + {children} + -} \ No newline at end of file + ); +} diff --git a/src/app/dev/profile/upload/background/[id]/loading.tsx b/src/app/dev/profile/upload/background/[id]/loading.tsx deleted file mode 100644 index b1f8b62f..00000000 --- a/src/app/dev/profile/upload/background/[id]/loading.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2"; - -export default async function Page() { - return ( - <> - - - ); -} diff --git a/src/app/dev/profile/upload/foto/[id]/layout.tsx b/src/app/dev/profile/upload/foto/[id]/layout.tsx index b381b860..5613eabd 100644 --- a/src/app/dev/profile/upload/foto/[id]/layout.tsx +++ b/src/app/dev/profile/upload/foto/[id]/layout.tsx @@ -1,9 +1,14 @@ import { UploadFotoProfileLayout } from "@/app_modules/katalog/profile"; import React from "react"; -export default async function Layout({children, params}: {children: React.ReactNode, params: {id: string}}) { - let profileId = params.id - return <> - {children} +export default async function Layout({ + children, +}: { + children: React.ReactNode; +}) { + return ( + <> + {children} -} \ No newline at end of file + ); +} diff --git a/src/app/dev/profile/upload/foto/[id]/loading.tsx b/src/app/dev/profile/upload/foto/[id]/loading.tsx deleted file mode 100644 index b1f8b62f..00000000 --- a/src/app/dev/profile/upload/foto/[id]/loading.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2"; - -export default async function Page() { - return ( - <> - - - ); -} diff --git a/src/app/dev/user_search/main/page.tsx b/src/app/dev/user-search/page.tsx similarity index 52% rename from src/app/dev/user_search/main/page.tsx rename to src/app/dev/user-search/page.tsx index 58f343db..7305259d 100644 --- a/src/app/dev/user_search/main/page.tsx +++ b/src/app/dev/user-search/page.tsx @@ -1,8 +1,8 @@ import { UserSearch_MainView } from "@/app_modules/user_search"; -import { UserSearch_getListUser } from "@/app_modules/user_search/fun/get/get_list_user"; +import { userSearch_getAllUser } from "@/app_modules/user_search/fun/get/get_all_user"; export default async function Page() { - const listUser = await UserSearch_getListUser({ name: "" }); + const listUser = await userSearch_getAllUser({ page: 1 }); return ; } diff --git a/src/app/dev/user_search/main/layout.tsx b/src/app/dev/user_search/main/layout.tsx deleted file mode 100644 index 31218acb..00000000 --- a/src/app/dev/user_search/main/layout.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import { LayoutUserSearch_MainView } from "@/app_modules/user_search"; -import React from "react"; - -export default async function Layout({ - children, -}: { - children: React.ReactNode; -}) { - return {children}; -} diff --git a/src/app/lib/router_hipmi/router_katalog.ts b/src/app/lib/router_hipmi/router_katalog.ts index 5d5bb8f7..25261c34 100644 --- a/src/app/lib/router_hipmi/router_katalog.ts +++ b/src/app/lib/router_hipmi/router_katalog.ts @@ -19,9 +19,13 @@ export const RouterProfile = { }; export const RouterPortofolio = { + main_detail: "/dev/portofolio/main/", + api_logo_porto: "/api/portofolio/logo/", create: "/dev/portofolio/create/", + daftar_portofolio: "/dev/portofolio/daftar-portofolio/", + //edit edit_data_bisnis: "/dev/portofolio/edit/data/", edit_logo_bisnis: "/dev/portofolio/edit/logo/", diff --git a/src/app/lib/router_hipmi/router_user_search.ts b/src/app/lib/router_hipmi/router_user_search.ts index 7aa2c19e..8b64a9f1 100644 --- a/src/app/lib/router_hipmi/router_user_search.ts +++ b/src/app/lib/router_hipmi/router_user_search.ts @@ -1,3 +1,3 @@ export const RouterUserSearch = { - main: "/dev/user_search/main" + main: "/dev/user-search" } \ No newline at end of file diff --git a/src/app/zCoba/page.tsx b/src/app/zCoba/page.tsx index 6cccd737..5e9b43ce 100644 --- a/src/app/zCoba/page.tsx +++ b/src/app/zCoba/page.tsx @@ -1,5 +1,5 @@ import ComponentGlobal_HeaderTamplate from "@/app_modules/component_global/header_tamplate"; -import ComponentGlobal_UI_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; +import UIGlobal_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; import Coba_TestLoading from "@/app_modules/zCoba"; import { Text } from "@mantine/core"; diff --git a/src/app_modules/auth/index.ts b/src/app_modules/auth/index.ts index 599f9aaa..e7f9843f 100644 --- a/src/app_modules/auth/index.ts +++ b/src/app_modules/auth/index.ts @@ -2,12 +2,12 @@ import SplashScreen from "./splash/view"; import Login from "./login/view"; import Validasi from "./validasi/view"; import Register from "./register/view"; -import User_Logout from "./logout/view"; +import Component_Logout from "./logout/view"; export { SplashScreen, Login, Validasi, Register, - User_Logout as Logout, + Component_Logout as Logout, }; diff --git a/src/app_modules/auth/logout/view.tsx b/src/app_modules/auth/logout/view.tsx index 51524892..d50ad426 100644 --- a/src/app_modules/auth/logout/view.tsx +++ b/src/app_modules/auth/logout/view.tsx @@ -1,6 +1,14 @@ "use client"; -import { ActionIcon, Button, Group, Modal, Stack, Title } from "@mantine/core"; +import { + ActionIcon, + Button, + Group, + Modal, + Stack, + Text, + Title, +} from "@mantine/core"; import { useRouter } from "next/navigation"; import { useAtom } from "jotai"; import { gs_kodeId, gs_nomor, gs_otp } from "../state/state"; @@ -12,13 +20,13 @@ import { auth_Logout } from "../fun/fun_logout"; import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan"; import { RouterAuth } from "@/app/lib/router_hipmi/router_auth"; import { useState } from "react"; +import ComponentGlobal_UI_Modal from "@/app_modules/component_global/ui/ui_modal"; -export default function User_Logout() { +export default function Component_Logout() { const router = useRouter(); - const [opened, { toggle }] = useDisclosure(false); + const [opened, setOpened] = useState(false); const [kodeId, setKodeId] = useAtom(gs_kodeId); const [loading, setLoading] = useState(false); - const [loading2, setLoading2] = useState(false); async function onClickLogout() { // await auth_Logout(kodeId).then((res) => { @@ -36,50 +44,52 @@ export default function User_Logout() { return ( <> - - - Anda yakin ingin keluar ? - - - - - - - {/* - - */} - + { + setLoading(false); + setOpened(false); + }} + radius={50} + > + Batal + + } + buttonKanan={ + + } + opened={opened} + close={() => setOpened(false)} + /> + + + { + setOpened(true); + }} + > + + + + Keluar + + ); } diff --git a/src/app_modules/auth/register/view.tsx b/src/app_modules/auth/register/view.tsx index 59dd2e1f..3eeec6e2 100644 --- a/src/app_modules/auth/register/view.tsx +++ b/src/app_modules/auth/register/view.tsx @@ -66,7 +66,7 @@ export default function Register({ dataOtp }: { dataOtp: any }) { if (val.status === 200) { ComponentGlobal_NotifikasiBerhasil(res.message); setLoading(true); - router.push(RouterHome.main_home); + router.push(RouterHome.main_home, { scroll: false }); } else { ComponentGlobal_NotifikasiPeringatan(val.message); } diff --git a/src/app_modules/auth/splash/view.tsx b/src/app_modules/auth/splash/view.tsx index 5ca2f9d8..0e84fa70 100644 --- a/src/app_modules/auth/splash/view.tsx +++ b/src/app_modules/auth/splash/view.tsx @@ -1,6 +1,7 @@ "use client"; import { MainColor } from "@/app_modules/component_global/color/color_pallet"; +import ComponentGlobal_SplashScreen from "@/app_modules/component_global/splash/splash_global"; import { BackgroundImage, Center, Image, Paper, Stack } from "@mantine/core"; import { useShallowEffect } from "@mantine/hooks"; import { useRouter } from "next/navigation"; @@ -11,12 +12,12 @@ export default function SplashScreen({ data }: { data: any }) { useShallowEffect(() => { if (!data) { setTimeout(() => { - return router.push("/dev/auth/login"); - }, 2000); + return router.push("/dev/auth/login", { scroll: false }); + }, 1000); } else { setTimeout(() => { - return router.push("/dev/home"); - }, 2000); + return router.push("/dev/home", { scroll: false }); + }, 1000); } }, []); diff --git a/src/app_modules/auth/validasi/view.tsx b/src/app_modules/auth/validasi/view.tsx index 2b729418..83c32c8d 100644 --- a/src/app_modules/auth/validasi/view.tsx +++ b/src/app_modules/auth/validasi/view.tsx @@ -48,7 +48,7 @@ export default function Validasi({ dataOtp }: { dataOtp: any }) { if (res.role === "1") { ComponentGlobal_NotifikasiBerhasil(res.message); setLoading(true); - router.push(RouterHome.main_home); + router.push(RouterHome.main_home, {scroll: false}); } else { router.push(RouterAdminDashboard.splash_admin); } diff --git a/src/app_modules/component_global/splash/splash_global.tsx b/src/app_modules/component_global/splash/splash_global.tsx index 97463ec2..b4f6e906 100644 --- a/src/app_modules/component_global/splash/splash_global.tsx +++ b/src/app_modules/component_global/splash/splash_global.tsx @@ -1,20 +1,20 @@ "use client"; import { Stack, Loader, ActionIcon, ThemeIcon } from "@mantine/core"; -import ComponentGlobal_UI_LayoutTamplate from "../ui/ui_layout_tamplate"; +import UIGlobal_LayoutTamplate from "../ui/ui_layout_tamplate"; import { IconMessages, IconX } from "@tabler/icons-react"; export default function ComponentGlobal_SplashScreen({ icon }: { icon: any }) { return ( <> - + {icon} - + ); } diff --git a/src/app_modules/component_global/ui/ui_drawer.tsx b/src/app_modules/component_global/ui/ui_drawer.tsx index ccbd53fe..8a2c077d 100644 --- a/src/app_modules/component_global/ui/ui_drawer.tsx +++ b/src/app_modules/component_global/ui/ui_drawer.tsx @@ -1,17 +1,23 @@ import { - Drawer, - Stack, - Group, ActionIcon, + Drawer, + Group, SimpleGrid, + Stack, Text, - Box, } from "@mantine/core"; -import { IconX, IconEdit } from "@tabler/icons-react"; -import { MainColor, AccentColor } from "../color/color_pallet"; -import React from "react"; +import { IconX } from "@tabler/icons-react"; import { useRouter } from "next/navigation"; +import { useState } from "react"; +import { AccentColor } from "../color/color_pallet"; +import ComponentGlobal_UI_Loader from "./ui_loader"; +interface MODEL_DRAWER { + id: string; + name: string; + icon: string; + path: string; +} export default function ComponentGlobal_UI_Drawer({ opened, close, @@ -19,9 +25,19 @@ export default function ComponentGlobal_UI_Drawer({ }: { opened: boolean; close: () => void; - component: any[]; + component: + | { + id: string; + name: string; + icon: string; + path: string; + }[] + | any[]; }) { const router = useRouter(); + const [isLoading, setIsLoading] = useState(false); + const [pageId, setPageId] = useState(""); + return ( <> - + {component.map((e, i) => ( router.push(e.path)} + onClick={() => { + setPageId(e?.id); + setIsLoading(true); + router.push(e?.path); + }} > - {e.icon} + {isLoading && e?.id === pageId ? ( + + ) : ( + e?.icon + )} - {e.name} + + {e?.name} + ))} diff --git a/src/app_modules/component_global/ui/ui_header_tamplate.tsx b/src/app_modules/component_global/ui/ui_header_tamplate.tsx index fdeab7d9..85093b23 100644 --- a/src/app_modules/component_global/ui/ui_header_tamplate.tsx +++ b/src/app_modules/component_global/ui/ui_header_tamplate.tsx @@ -11,19 +11,21 @@ import { } from "@mantine/core"; import { IconArrowLeft, IconChevronLeft } from "@tabler/icons-react"; import { useRouter } from "next/navigation"; -import { useState } from "react"; +import React, { useState } from "react"; import { AccentColor, MainColor } from "../color/color_pallet"; -export default function ComponentGlobal_UI_HeaderTamplate({ +export default function UIGlobal_LayoutHeaderTamplate({ title, posotion, // left button hideButtonLeft, iconLeft, routerLeft, + customButtonLeft, // right button iconRight, routerRight, + customButtonRight, }: { title: string; posotion?: any; @@ -31,9 +33,11 @@ export default function ComponentGlobal_UI_HeaderTamplate({ hideButtonLeft?: boolean; iconLeft?: any; routerLeft?: any; + customButtonLeft?: React.ReactNode; // right button iconRight?: any; routerRight?: any; + customButtonRight?: React.ReactNode; }) { const router = useRouter(); const [isLoading, setIsLoading] = useState(false); @@ -53,6 +57,8 @@ export default function ComponentGlobal_UI_HeaderTamplate({ {hideButtonLeft ? ( + ) : customButtonLeft ? ( + customButtonLeft ) : ( {isLoading ? ( @@ -79,7 +85,9 @@ export default function ComponentGlobal_UI_HeaderTamplate({ {title} - {iconRight === undefined ? ( + {customButtonRight ? ( + customButtonRight + ) : iconRight === undefined ? ( ) : routerRight === undefined ? ( {iconRight} diff --git a/src/app_modules/component_global/ui/ui_layout_tamplate.tsx b/src/app_modules/component_global/ui/ui_layout_tamplate.tsx index 652254b1..57c900c2 100644 --- a/src/app_modules/component_global/ui/ui_layout_tamplate.tsx +++ b/src/app_modules/component_global/ui/ui_layout_tamplate.tsx @@ -1,13 +1,17 @@ +"use client"; + import { BackgroundImage, Box, Container, Footer, + rem, ScrollArea, } from "@mantine/core"; import { AccentColor, MainColor } from "../color/color_pallet"; +import React from "react"; -export default function ComponentGlobal_UI_LayoutTamplate({ +export default function UIGlobal_LayoutTamplate({ children, header, footer, @@ -18,56 +22,105 @@ export default function ComponentGlobal_UI_LayoutTamplate({ }) { return ( <> - - {/* Header */} - {header ? ( - + + - {header} - - ) : ( - "" - )} + - {/* Children */} - - - {children} - - + {children} - {/* Footer */} - {footer ? ( - - - {footer} - - - ) : ( - "" - )} - + + + + + + ); +} + +function UIHeader({ header }: { header: React.ReactNode }) { + return ( + <> + {header ? ( + + {header} + + ) : ( + "" + )} + + ); +} + +function UIChildren({ + children, + footer, +}: { + children: React.ReactNode; + footer: React.ReactNode; +}) { + return ( + <> + + + {children} + + + + ); +} + +function UIFooter({ footer }: { footer: React.ReactNode }) { + return ( + <> + {footer ? ( + + + {footer} + + + ) : ( + "" + )} ); } diff --git a/src/app_modules/component_global/ui/ui_loader.tsx b/src/app_modules/component_global/ui/ui_loader.tsx new file mode 100644 index 00000000..54333cf3 --- /dev/null +++ b/src/app_modules/component_global/ui/ui_loader.tsx @@ -0,0 +1,10 @@ +import { Loader } from "@mantine/core"; +import { MainColor } from "../color/color_pallet"; + +export default function ComponentGlobal_UI_Loader({ size }: { size?: number }) { + return ( + <> + + + ); +} diff --git a/src/app_modules/forum/component/detail_component/ui_report_komentar.tsx b/src/app_modules/forum/component/detail_component/ui_report_komentar.tsx new file mode 100644 index 00000000..7a1aaae2 --- /dev/null +++ b/src/app_modules/forum/component/detail_component/ui_report_komentar.tsx @@ -0,0 +1,66 @@ +"use client" + +import { Stack, Paper, Text, List, Box } from "@mantine/core"; +import { useState } from "react"; +import { MODEL_FORUM_KOMENTAR } from "../../model/interface"; +import { AccentColor, MainColor } from "@/app_modules/component_global/color/color_pallet"; + +export function ComponentForum_UiDetailReportKomentar({ + dataKomentar, +}: { + dataKomentar: any; +}) { + const [data, setData] = useState(dataKomentar.data); + const [list, setList] = useState(dataKomentar.list); + return ( + <> + + + + Komentar anda telah dihapus dari sebuah postingan oleh ADMIN, karena + memiliki beberapa laporan dari pengguna lain ! + + + + Komentar anda + + +
+ + + + + + + Pada postingan : {data.Forum_Posting.Author.username} + + + +
+ + + + + Laporan yang diterima : + + {list.map((x, i) => ( + {x} + ))} + + + + + + ); +} \ No newline at end of file diff --git a/src/app_modules/forum/component/detail_component/ui_report_posting.tsx b/src/app_modules/forum/component/detail_component/ui_report_posting.tsx new file mode 100644 index 00000000..84de8f62 --- /dev/null +++ b/src/app_modules/forum/component/detail_component/ui_report_posting.tsx @@ -0,0 +1,61 @@ +"use client"; + +import { Stack, Paper, Text, List, Box } from "@mantine/core"; +import { useState } from "react"; +import { MODEL_FORUM_POSTING } from "../../model/interface"; +import { + AccentColor, + MainColor, +} from "@/app_modules/component_global/color/color_pallet"; + +export function ComponentForum_UiDetailReportPosting({ + dataPosting, +}: { + dataPosting: any; +}) { + const [data, setData] = useState(dataPosting.data); + const [list, setList] = useState(dataPosting.list); + + return ( + <> + + + + Postingan anda telah dihapus dari beranda oleh ADMIN, karena + memiliki beberapa laporan dari pengguna lain ! + + + Pada postingan + + +
+ + + + + + Laporan yang diterima : + + {list.map((x, i) => ( + + {x} + + ))} + + + + + + ); +} diff --git a/src/app_modules/forum/create/layout.tsx b/src/app_modules/forum/create/layout.tsx index 5b9be6e3..b5131ef3 100644 --- a/src/app_modules/forum/create/layout.tsx +++ b/src/app_modules/forum/create/layout.tsx @@ -4,8 +4,8 @@ import { AppShell } from "@mantine/core"; import React from "react"; import ComponentForum_HeaderTamplate from "../component/header/header_tamplate"; import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate"; -import ComponentGlobal_UI_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; -import ComponentGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate"; +import UIGlobal_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; +import UIGlobal_LayoutHeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate"; export default function LayoutForum_Create({ children, @@ -14,11 +14,11 @@ export default function LayoutForum_Create({ }) { return ( <> - } + } > {children} - + {/* }> diff --git a/src/app_modules/forum/detail/detail_report_komentar.tsx b/src/app_modules/forum/detail/detail_report_komentar.tsx index 85bc8a68..ebdf24ee 100644 --- a/src/app_modules/forum/detail/detail_report_komentar.tsx +++ b/src/app_modules/forum/detail/detail_report_komentar.tsx @@ -1,19 +1,7 @@ -"use client"; +import UIGlobal_LayoutHeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate"; +import UIGlobal_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; +import { ComponentForum_UiDetailReportKomentar } from "../component/detail_component/ui_report_komentar"; -import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate"; -import ComponentForum_HeaderTamplate from "../component/header/header_tamplate"; -import { - Box, - Center, - Group, - List, - Paper, - Stack, - Text, - Title, -} from "@mantine/core"; -import { MODEL_FORUM_KOMENTAR, MODEL_FORUM_POSTING } from "../model/interface"; -import { useState } from "react"; export default function Forum_DetailReportKomentar({ dataKomentar, @@ -22,58 +10,13 @@ export default function Forum_DetailReportKomentar({ }) { return ( <> - } + } > - {} - + {} + ); } -function View({ dataKomentar }: { dataKomentar: any }) { - const [data, setData] = useState(dataKomentar.data); - const [list, setList] = useState(dataKomentar.list); - return ( - <> - - - Komentar anda telah dihapus dari sebuah postingan oleh ADMIN, karena - memiliki beberapa laporan dari pengguna lain ! - - - Komentar anda - - -
- - - - - - - Pada postingan : {data.Forum_Posting.Author.username} - - - -
- - - - - Laporan yang diterima : - - {list.map((x, i) => ( - {x} - ))} - - - - - ); -} diff --git a/src/app_modules/forum/detail/detail_report_posting.tsx b/src/app_modules/forum/detail/detail_report_posting.tsx index 0f3f993c..71f09dfc 100644 --- a/src/app_modules/forum/detail/detail_report_posting.tsx +++ b/src/app_modules/forum/detail/detail_report_posting.tsx @@ -1,10 +1,7 @@ -"use client"; - -import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate"; -import ComponentForum_HeaderTamplate from "../component/header/header_tamplate"; -import { List, Paper, Stack, Text } from "@mantine/core"; -import { MODEL_FORUM_POSTING } from "../model/interface"; -import { useState } from "react"; +import UIGlobal_LayoutHeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate"; +import UIGlobal_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; +import { Stack, Text } from "@mantine/core"; +import { ComponentForum_UiDetailReportPosting } from "../component/detail_component/ui_report_posting"; export default function Forum_DetailReportPosting({ dataPosting, @@ -13,49 +10,11 @@ export default function Forum_DetailReportPosting({ }) { return ( <> - } + } > - - - - ); -} - -function View({ dataPosting }: { dataPosting: any }) { - const [data, setData] = useState(dataPosting.data); - const [list, setList] = useState(dataPosting.list); - - return ( - <> - - - Postingan anda telah dihapus dari beranda oleh ADMIN, karena memiliki - beberapa laporan dari pengguna lain ! - - - - Pada postingan - - -
- - - - - - Laporan yang diterima : - - {list.map((x, i) => ( - {x} - ))} - - - + + ); } diff --git a/src/app_modules/forum/detail/layout.tsx b/src/app_modules/forum/detail/layout.tsx index 51745523..20ddfe01 100644 --- a/src/app_modules/forum/detail/layout.tsx +++ b/src/app_modules/forum/detail/layout.tsx @@ -8,8 +8,8 @@ import { IconChevronLeft } from "@tabler/icons-react"; import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2"; import { revalidatePath } from "next/cache"; import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate"; -import ComponentGlobal_UI_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; -import ComponentGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate"; +import UIGlobal_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; +import UIGlobal_LayoutHeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate"; export const dynamic = "force-dynamic"; export default function LayoutForum_Detail({ @@ -24,11 +24,11 @@ export default function LayoutForum_Detail({ return ( <> - } + } > {children} - + {/* - } + } > {children} - + {/* } diff --git a/src/app_modules/forum/forumku/layout.tsx b/src/app_modules/forum/forumku/layout.tsx index 2ea05fa3..070adeeb 100644 --- a/src/app_modules/forum/forumku/layout.tsx +++ b/src/app_modules/forum/forumku/layout.tsx @@ -6,8 +6,8 @@ import ComponentForum_HeaderTamplate from "../component/header/header_tamplate"; import { MODEL_USER } from "@/app_modules/home/model/interface"; import { IconX } from "@tabler/icons-react"; import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate"; -import ComponentGlobal_UI_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; -import ComponentGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate"; +import UIGlobal_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; +import UIGlobal_LayoutHeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate"; export default function LayoutForum_Forumku({ children, @@ -18,16 +18,16 @@ export default function LayoutForum_Forumku({ }) { return ( <> - } /> } > {children} - + {/* - + (
diff --git a/src/app_modules/forum/main/layout.tsx b/src/app_modules/forum/main/layout.tsx index 39e9266e..bc5eda29 100644 --- a/src/app_modules/forum/main/layout.tsx +++ b/src/app_modules/forum/main/layout.tsx @@ -26,8 +26,8 @@ import { MODEL_USER } from "@/app_modules/home/model/interface"; import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog"; import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2"; import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate"; -import ComponentGlobal_UI_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; -import ComponentGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate"; +import UIGlobal_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; +import UIGlobal_LayoutHeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate"; export default function LayoutForum_Main({ children, @@ -43,9 +43,9 @@ export default function LayoutForum_Main({ return ( <> - {children} - + {/* - + } > {children} - + {/* diff --git a/src/app_modules/forum/report/posting/layout.tsx b/src/app_modules/forum/report/posting/layout.tsx index 0b9b250b..53316d06 100644 --- a/src/app_modules/forum/report/posting/layout.tsx +++ b/src/app_modules/forum/report/posting/layout.tsx @@ -1,7 +1,7 @@ "use client"; -import ComponentGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate"; -import ComponentGlobal_UI_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; +import UIGlobal_LayoutHeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate"; +import UIGlobal_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; import React from "react"; export default function LayoutForum_ReportPosting({ @@ -11,13 +11,13 @@ export default function LayoutForum_ReportPosting({ }) { return ( <> - + } > {children} - + diff --git a/src/app_modules/forum/splash/index.tsx b/src/app_modules/forum/splash/index.tsx index 195c03db..2daa2c84 100644 --- a/src/app_modules/forum/splash/index.tsx +++ b/src/app_modules/forum/splash/index.tsx @@ -2,7 +2,7 @@ import { RouterForum } from "@/app/lib/router_hipmi/router_forum"; import ComponentGlobal_SplashScreen from "@/app_modules/component_global/splash/splash_global"; -import ComponentGlobal_UI_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; +import UIGlobal_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; import { Avatar, Center, @@ -20,7 +20,7 @@ export default function Forum_Splash() { const router = useRouter(); useShallowEffect(() => { setTimeout(() => { - router.replace(RouterForum.beranda); + router.replace(RouterForum.beranda, { scroll: false }); }, 1000); }, []); diff --git a/src/app_modules/home/component/button_header.tsx b/src/app_modules/home/component/button_header.tsx new file mode 100644 index 00000000..6378216a --- /dev/null +++ b/src/app_modules/home/component/button_header.tsx @@ -0,0 +1,106 @@ +"use client"; + +import UIGlobal_LayoutHeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate"; +import { ActionIcon, Indicator, Loader, Text } from "@mantine/core"; +import { MODEL_USER } from "../model/interface"; +import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan"; +import { useState } from "react"; +import { useRouter } from "next/navigation"; +import { RouterUserSearch } from "@/app/lib/router_hipmi/router_user_search"; +import { + AccentColor, + MainColor, +} from "@/app_modules/component_global/color/color_pallet"; +import { IconBell, IconUserSearch } from "@tabler/icons-react"; +import { RouterNotifikasi } from "@/app/lib/router_hipmi/router_notifikasi"; +import { useShallowEffect } from "@mantine/hooks"; +import notifikasi_countUserNotifikasi from "@/app_modules/notifikasi/fun/count/fun_count_by_id"; + +export function ComponentHome_ButtonHeaderLeft({ + dataUser, +}: { + dataUser: MODEL_USER; +}) { + const router = useRouter(); + const [isLoadingUS, setIsLoadingUS] = useState(false); + + return ( + <> + { + if (dataUser?.Profile === null) { + ComponentGlobal_NotifikasiPeringatan("Lengkapi Profile"); + } else { + setIsLoadingUS(true); + router.push(RouterUserSearch.main, { scroll: false }); + } + }} + > + {isLoadingUS ? ( + + ) : ( + + )} + + + ); +} + +export function ComponentHome_ButtonHeaderRight({ + dataUser, + countNotifikasi, +}: { + dataUser: MODEL_USER; + countNotifikasi: number; +}) { + const router = useRouter(); + const [count, setCount] = useState(countNotifikasi); + const [isLoadingBell, setIsLoadingBell] = useState(false); + + useShallowEffect(() => { + onLoadNotifkasi({ + onLoad(val) { + setCount(val); + }, + }); + }, []); + + async function onLoadNotifkasi({ onLoad }: { onLoad: (val: any) => void }) { + const loadNotifikasi = await notifikasi_countUserNotifikasi(); + onLoad(loadNotifikasi); + } + + return ( + <> + { + if (dataUser?.Profile === null) { + ComponentGlobal_NotifikasiPeringatan("Lengkapi Profile"); + } else { + router.push(RouterNotifikasi.main, { scroll: false }); + setIsLoadingBell(true); + } + }} + > + {isLoadingBell ? ( + + ) : ( + + {count > 99 ? "99+" : count} + + } + > + + + )} + + + ); +} diff --git a/src/app_modules/home/view.tsx b/src/app_modules/home/component/ui_home.tsx similarity index 58% rename from src/app_modules/home/view.tsx rename to src/app_modules/home/component/ui_home.tsx index bd984546..935c09fc 100644 --- a/src/app_modules/home/view.tsx +++ b/src/app_modules/home/component/ui_home.tsx @@ -1,43 +1,49 @@ "use client"; -import { - ActionIcon, - Box, - Center, - Group, - Image, - Loader, - LoadingOverlay, - Overlay, - Paper, - SimpleGrid, - Stack, - Text, -} from "@mantine/core"; - -import { - IconAffiliate, - IconBriefcase, - IconHeartHandshake, - IconPackageImport, - IconPresentation, - IconUserSearch, -} from "@tabler/icons-react"; - import { RouterColab } from "@/app/lib/router_hipmi/router_colab"; import { RouterEvent } from "@/app/lib/router_hipmi/router_event"; import { RouterJob } from "@/app/lib/router_hipmi/router_job"; import { RouterVote } from "@/app/lib/router_hipmi/router_vote"; +import { + AccentColor, + MainColor, +} from "@/app_modules/component_global/color/color_pallet"; +import ComponentGlobal_IsEmptyData from "@/app_modules/component_global/is_empty_data"; +import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan"; +import { + Box, + Paper, + Stack, + SimpleGrid, + ActionIcon, + Loader, + Group, + Image, + Text, + Avatar, + Center, +} from "@mantine/core"; +import { + IconPresentation, + IconAffiliate, + IconPackageImport, + IconHeartHandshake, + IconBriefcase, + IconUserSearch, + IconMap2, + IconMessages, + IconShoppingBag, + IconUserCircle, +} from "@tabler/icons-react"; import _ from "lodash"; import { useRouter } from "next/navigation"; import { useState } from "react"; -import { AccentColor, MainColor } from "../component_global/color/color_pallet"; -import ComponentGlobal_IsEmptyData from "../component_global/is_empty_data"; -import { ComponentGlobal_NotifikasiPeringatan } from "../component_global/notif_global/notifikasi_peringatan"; -import { MODEL_JOB } from "../job/model/interface"; -import { MODEL_USER } from "./model/interface"; +import { MODEL_USER } from "../model/interface"; +import { MODEL_JOB } from "@/app_modules/job/model/interface"; +import { RouterForum } from "@/app/lib/router_hipmi/router_forum"; +import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog"; -export default function HomeView({ +export function Home_UiView({ dataUser, dataJob, }: { @@ -86,7 +92,7 @@ export default function HomeView({ return ( <> - + @@ -230,3 +237,123 @@ export default function HomeView({ ); } + +const listHalamanFooter = [ + { + id: 1, + name: "Forums", + icon: , + link: RouterForum.splash, + }, + + { + id: 2, + name: "MarketPlace", + icon: , + link: "", + }, + { + id: 3, + name: "Business Maps", + icon: , + link: "", + }, +]; + +export function Home_UiFooter({ dataUser }: { dataUser: MODEL_USER }) { + const router = useRouter(); + const [isLoadingProfil, setIsLoadingProfile] = useState(false); + const [isLoadingPage, setIsLoadingPage] = useState(false); + const [pageId, setPageId] = useState(0); + return ( + <> + + + {listHalamanFooter.map((e, i) => ( +
+ + { + if (dataUser?.Profile === null) { + ComponentGlobal_NotifikasiPeringatan("Lengkapi Profile"); + } else { + e.link === "" + ? ComponentGlobal_NotifikasiPeringatan("Cooming Soon") + : (router.push(e.link, { scroll: false }), + setIsLoadingPage(true), + setPageId(e?.id)); + } + }} + > + {isLoadingPage && e.id === pageId ? ( + + ) : ( + e.icon + )} + + + {e.name} + + +
+ ))} + +
+ { + setIsLoadingProfile(true); + if (dataUser?.Profile === null) { + router.push(RouterProfile.create, { scroll: false }); + } else { + router.push( + RouterProfile.katalog + `${dataUser?.Profile?.id}`, + { scroll: false } + ); + } + }} + > + + {dataUser?.Profile === null ? ( + + ) : isLoadingProfil ? ( + + ) : ( + + )} + + + Profile + + +
+
+
+ + ); +} diff --git a/src/app_modules/home/index.ts b/src/app_modules/home/index.ts index 713cdd1b..07785dd4 100644 --- a/src/app_modules/home/index.ts +++ b/src/app_modules/home/index.ts @@ -1,5 +1,4 @@ -import HomeView from "./view"; -import HomeLayout from "./layout"; +import HomeView from "./view_home"; import Home_UserNotActive from "./user_non_active"; -export { HomeView, HomeLayout, Home_UserNotActive as Home_UserNonActive }; +export { HomeView, Home_UserNotActive as Home_UserNonActive }; diff --git a/src/app_modules/home/layout.tsx b/src/app_modules/home/layout.tsx deleted file mode 100644 index ba42b607..00000000 --- a/src/app_modules/home/layout.tsx +++ /dev/null @@ -1,310 +0,0 @@ -"use client"; -import { - ActionIcon, - AppShell, - Avatar, - BackgroundImage, - Box, - Center, - Flex, - Footer, - Grid, - Group, - Header, - Indicator, - Loader, - Paper, - ScrollArea, - SimpleGrid, - Stack, - Text, - ThemeIcon, - Title, -} from "@mantine/core"; -import { HomeView } from "."; -import { - IconUserSearch, - IconAward, - IconQrcode, - IconUserCircle, - IconBell, - IconMessages, - IconShoppingBag, - IconMap2, -} from "@tabler/icons-react"; -import { Logout } from "../auth"; -import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog"; -import { MODEL_USER } from "./model/interface"; -import React, { useState } from "react"; -import { useRouter } from "next/navigation"; -import { ComponentGlobal_NotifikasiPeringatan } from "../component_global/notif_global/notifikasi_peringatan"; -import { ComponentGlobal_NotifikasiBerhasil } from "../component_global/notif_global/notifikasi_berhasil"; -import { RouterUserSearch } from "@/app/lib/router_hipmi/router_user_search"; -import { RouterNotifikasi } from "@/app/lib/router_hipmi/router_notifikasi"; -import { useShallowEffect } from "@mantine/hooks"; -import notifikasi_countUserNotifikasi from "../notifikasi/fun/count/fun_count_by_id"; -import mqtt_client from "@/util/mqtt_client"; -import { AccentColor, MainColor } from "../component_global/color/color_pallet"; -import { RouterForum } from "@/app/lib/router_hipmi/router_forum"; - -export default function HomeLayout({ - dataUser, - children, - countNotifikasi, -}: { - dataUser: MODEL_USER; - children: React.ReactNode; - countNotifikasi: number; -}) { - const router = useRouter(); - // const [user, setUser] = useState(dataUser); - const [isLoadingProfil, setIsLoadingProfile] = useState(false); - const [isLoadingUS, setIsLoadingUS] = useState(false); - const [isLoadingBell, setIsLoadingBell] = useState(false); - const [isLoadingPage, setIsLoadingPage] = useState(false); - const [pageId, setPageId] = useState(0); - - const [countNotif, setCountNotif] = useState(countNotifikasi); - - const listHalamanFooter = [ - { - id: 1, - name: "Forums", - icon: , - link: RouterForum.splash, - }, - - { - id: 2, - name: "MarketPlace", - icon: , - link: "", - }, - { - id: 3, - name: "Business Maps", - icon: , - link: "", - }, - ]; - - useShallowEffect(() => { - mqtt_client.subscribe("USER"); - - mqtt_client.on("message", (topic: any, message: any) => { - // console.log(topic); - const data = JSON.parse(message.toString()); - - if (data.userId === dataUser.id) { - setCountNotif(countNotif + data.count); - } - }); - - onLoadNotifikasi({ - onLoad(val) { - setCountNotif(val); - }, - }); - }, [countNotif]); - - async function onLoadNotifikasi({ onLoad }: { onLoad: (val: any) => void }) { - const loadNotif = await notifikasi_countUserNotifikasi(); - onLoad(loadNotif); - } - - return ( - <> - - {/* Header */} - - - { - if (dataUser?.Profile === null) { - ComponentGlobal_NotifikasiPeringatan("Lengkapi Profile"); - } else { - setIsLoadingUS(true); - router.push(RouterUserSearch.main); - } - }} - > - {isLoadingUS ? ( - - ) : ( - - )} - - -
- - HIPMI - -
- { - if (dataUser?.Profile === null) { - ComponentGlobal_NotifikasiPeringatan("Lengkapi Profile"); - } else { - router.push(RouterNotifikasi.main); - setIsLoadingBell(true); - } - }} - > - {isLoadingBell ? ( - - ) : ( - - {countNotif} - - } - > - - - )} - -
-
- - {/* Children */} - - - {/* {Array(10) - .fill(0) - .map((e, i) => ( - - {i + 1} - - ))} */} - {children} - - - - - - {/* Footer */} - - - {listHalamanFooter.map((e, i) => ( -
- - { - if (dataUser?.Profile === null) { - ComponentGlobal_NotifikasiPeringatan( - "Lengkapi Profile" - ); - } else { - e.link === "" - ? ComponentGlobal_NotifikasiPeringatan("Cooming Soon") - : (router.push(e.link), - setIsLoadingPage(true), - setPageId(e?.id)); - } - }} - > - {isLoadingPage && e.id === pageId ? ( - - ) : ( - e.icon - )} - - - {e.name} - - -
- ))} - -
- { - setIsLoadingProfile(true); - if (dataUser?.Profile === null) { - router.push(RouterProfile.create); - } else { - router.push( - RouterProfile.katalog + `${dataUser.Profile.id}` - ); - } - }} - > - - {dataUser?.Profile === null ? ( - - ) : isLoadingProfil ? ( - - ) : ( - - )} - - - Profile - - -
-
-
-
- - ); -} diff --git a/src/app_modules/home/user_non_active/index.tsx b/src/app_modules/home/user_non_active/index.tsx index 4819f567..915391b6 100644 --- a/src/app_modules/home/user_non_active/index.tsx +++ b/src/app_modules/home/user_non_active/index.tsx @@ -1,7 +1,7 @@ "use client"; import { Logout } from "@/app_modules/auth"; -import User_Logout from "@/app_modules/auth/logout/view"; +import Component_Logout from "@/app_modules/auth/logout/view"; import { Center, Group, Skeleton, Stack, Text, Title } from "@mantine/core"; export default function Home_UserNotActive() { @@ -44,7 +44,7 @@ export default function Home_UserNotActive() { Tunggu Konfirmasi Admin ! - +
diff --git a/src/app_modules/home/view_home.tsx b/src/app_modules/home/view_home.tsx new file mode 100644 index 00000000..eae253b1 --- /dev/null +++ b/src/app_modules/home/view_home.tsx @@ -0,0 +1,43 @@ +import UIGlobal_LayoutHeaderTamplate from "../component_global/ui/ui_header_tamplate"; +import UIGlobal_LayoutTamplate from "../component_global/ui/ui_layout_tamplate"; +import { MODEL_JOB } from "../job/model/interface"; +import { + ComponentHome_ButtonHeaderLeft, + ComponentHome_ButtonHeaderRight, +} from "./component/button_header"; +import { Home_UiFooter, Home_UiView } from "./component/ui_home"; +import { MODEL_USER } from "./model/interface"; + +export default function HomeView({ + dataUser, + dataJob, + countNotifikasi, +}: { + dataUser: MODEL_USER; + dataJob: MODEL_JOB[]; + countNotifikasi: number; +}) { + return ( + <> + + } + customButtonRight={ + + } + /> + } + footer={} + > + + + + ); +} diff --git a/src/app_modules/job/create/layout.tsx b/src/app_modules/job/create/layout.tsx index 5b6760db..5dd2ccd2 100644 --- a/src/app_modules/job/create/layout.tsx +++ b/src/app_modules/job/create/layout.tsx @@ -1,7 +1,7 @@ "use client"; -import ComponentGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate"; -import ComponentGlobal_UI_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; +import UIGlobal_LayoutHeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate"; +import UIGlobal_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; import React from "react"; export default function LayoutJob_Create({ @@ -11,11 +11,11 @@ export default function LayoutJob_Create({ }) { return ( <> - } + } > {children} - + ); } diff --git a/src/app_modules/job/detail/arsip/layout.tsx b/src/app_modules/job/detail/arsip/layout.tsx index ba6f7284..88d07b13 100644 --- a/src/app_modules/job/detail/arsip/layout.tsx +++ b/src/app_modules/job/detail/arsip/layout.tsx @@ -1,7 +1,7 @@ "use client"; -import ComponentGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate"; -import ComponentGlobal_UI_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; +import UIGlobal_LayoutHeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate"; +import UIGlobal_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; import React from "react"; export default function LayoutJob_DetailArsip({ @@ -11,11 +11,11 @@ export default function LayoutJob_DetailArsip({ }) { return ( <> - } + } > {children} - + ); } diff --git a/src/app_modules/job/detail/draft/layout.tsx b/src/app_modules/job/detail/draft/layout.tsx index 6d8946e2..7d117cec 100644 --- a/src/app_modules/job/detail/draft/layout.tsx +++ b/src/app_modules/job/detail/draft/layout.tsx @@ -14,11 +14,11 @@ import { } from "@mantine/core"; import React from "react"; import ComponentJob_HeaderTamplate from "../../component/header_tamplate"; -import { IconDots, IconEdit, IconX } from "@tabler/icons-react"; +import { IconDots, IconDotsVertical, IconEdit, IconX } from "@tabler/icons-react"; import { RouterJob } from "@/app/lib/router_hipmi/router_job"; import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate"; -import ComponentGlobal_UI_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; -import ComponentGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate"; +import UIGlobal_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; +import UIGlobal_LayoutHeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate"; import { useRouter } from "next/navigation"; import { useDisclosure } from "@mantine/hooks"; import { @@ -48,13 +48,13 @@ export default function LayoutJob_DetailDraft({ return ( <> - open()}> - + } // routerRight={} @@ -62,7 +62,7 @@ export default function LayoutJob_DetailDraft({ } > {children} - + - } + } > {children} - + ); } diff --git a/src/app_modules/job/detail/publish/layout.tsx b/src/app_modules/job/detail/publish/layout.tsx index ef1caf7c..2313d9d5 100644 --- a/src/app_modules/job/detail/publish/layout.tsx +++ b/src/app_modules/job/detail/publish/layout.tsx @@ -1,7 +1,7 @@ "use client"; -import ComponentGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate"; -import ComponentGlobal_UI_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; +import UIGlobal_LayoutHeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate"; +import UIGlobal_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; import React from "react"; export default function LayoutJob_DetailPublish({ @@ -11,11 +11,11 @@ export default function LayoutJob_DetailPublish({ }) { return ( <> - } + } > {children} - + ); } diff --git a/src/app_modules/job/detail/reject/layout.tsx b/src/app_modules/job/detail/reject/layout.tsx index e8d3e8b8..7a237dbd 100644 --- a/src/app_modules/job/detail/reject/layout.tsx +++ b/src/app_modules/job/detail/reject/layout.tsx @@ -5,8 +5,8 @@ import React from "react"; import ComponentJob_HeaderTamplate from "../../component/header_tamplate"; import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate"; import { RouterJob } from "@/app/lib/router_hipmi/router_job"; -import ComponentGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate"; -import ComponentGlobal_UI_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; +import UIGlobal_LayoutHeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate"; +import UIGlobal_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; import { IconEdit } from "@tabler/icons-react"; export default function LayoutJob_DetailReject({ @@ -16,11 +16,11 @@ export default function LayoutJob_DetailReject({ }) { return ( <> - } + } > {children} - + ); } diff --git a/src/app_modules/job/detail/review/layout.tsx b/src/app_modules/job/detail/review/layout.tsx index ccf9cc7d..8954e16a 100644 --- a/src/app_modules/job/detail/review/layout.tsx +++ b/src/app_modules/job/detail/review/layout.tsx @@ -1,7 +1,7 @@ "use client"; -import ComponentGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate"; -import ComponentGlobal_UI_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; +import UIGlobal_LayoutHeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate"; +import UIGlobal_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; import React from "react"; export default function LayoutJob_DetailReview({ @@ -11,11 +11,11 @@ export default function LayoutJob_DetailReview({ }) { return ( <> - } + } > {children} - + ); } diff --git a/src/app_modules/job/edit/layout.tsx b/src/app_modules/job/edit/layout.tsx index 4d08b611..ca17e086 100644 --- a/src/app_modules/job/edit/layout.tsx +++ b/src/app_modules/job/edit/layout.tsx @@ -1,7 +1,7 @@ "use client"; -import ComponentGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate"; -import ComponentGlobal_UI_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; +import UIGlobal_LayoutHeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate"; +import UIGlobal_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; import React from "react"; export default function LayoutJob_Edit({ @@ -11,11 +11,11 @@ export default function LayoutJob_Edit({ }) { return ( <> - } + } > {children} - + ); diff --git a/src/app_modules/job/main/beranda/ui_beranda.tsx b/src/app_modules/job/main/beranda/ui_beranda.tsx index 0d282dd7..37ffff7f 100644 --- a/src/app_modules/job/main/beranda/ui_beranda.tsx +++ b/src/app_modules/job/main/beranda/ui_beranda.tsx @@ -9,6 +9,7 @@ import { ScrollOnly } from "next-scroll-loader"; import ComponentJob_BerandaCardView from "../../component/beranda/card_view"; import { job_getAllListPublish } from "../../fun/get/get_all_publish"; import ComponentJob_CreateButton from "../../component/button/create_button"; +import { IconSearch } from "@tabler/icons-react"; export function Job_UiBeranda({ listData }: { listData: MODEL_JOB[] }) { const [data, setData] = useState(listData); @@ -31,12 +32,14 @@ export function Job_UiBeranda({ listData }: { listData: MODEL_JOB[] }) { } placeholder="Pekerjaan apa yang anda cari ?" onChange={(val) => { onSearch(val.currentTarget.value); diff --git a/src/app_modules/job/main/layout.tsx b/src/app_modules/job/main/layout.tsx index 3c65fff7..291296d4 100644 --- a/src/app_modules/job/main/layout.tsx +++ b/src/app_modules/job/main/layout.tsx @@ -3,8 +3,8 @@ import { RouterJob } from "@/app/lib/router_hipmi/router_job"; import { MainColor } from "@/app_modules/component_global/color/color_pallet"; import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan"; -import ComponentGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate"; -import ComponentGlobal_UI_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; +import UIGlobal_LayoutHeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate"; +import UIGlobal_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; import { ActionIcon, SimpleGrid, Stack, Text } from "@mantine/core"; import { IconHistory, IconHome, IconReservedLine } from "@tabler/icons-react"; import { useAtom } from "jotai"; @@ -46,9 +46,9 @@ export default function LayoutJob_Main({ return ( <> - @@ -118,7 +118,7 @@ export default function LayoutJob_Main({ } > {children} - + ); } diff --git a/src/app_modules/job/non_user_view/layout.tsx b/src/app_modules/job/non_user_view/layout.tsx index 24906397..81798eec 100644 --- a/src/app_modules/job/non_user_view/layout.tsx +++ b/src/app_modules/job/non_user_view/layout.tsx @@ -4,8 +4,8 @@ import { AppShell, Center } from "@mantine/core"; import React from "react"; import ComponentJob_HeaderTamplate from "../component/header_tamplate"; import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate"; -import ComponentGlobal_UI_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; -import ComponentGlobal_UI_HeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate"; +import UIGlobal_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; +import UIGlobal_LayoutHeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate"; export default function LayoutJob_NonUserView({ children, @@ -14,11 +14,11 @@ export default function LayoutJob_NonUserView({ }) { return ( <> - } + } > {children} - + ); } diff --git a/src/app_modules/job/splash/ui_splash.tsx b/src/app_modules/job/splash/ui_splash.tsx index c5f3ac6e..af1322e6 100644 --- a/src/app_modules/job/splash/ui_splash.tsx +++ b/src/app_modules/job/splash/ui_splash.tsx @@ -18,7 +18,7 @@ export function Job_UiSplash() { setTimeout(() => { setHotMenu(1); setStatus("Publish"); - router.replace(RouterJob.beranda); + router.replace(RouterJob.beranda, { scroll: false }); }, 1000); }, []); return ( diff --git a/src/app_modules/katalog/component/button_header_right.tsx b/src/app_modules/katalog/component/button_header_right.tsx new file mode 100644 index 00000000..dc0bdd32 --- /dev/null +++ b/src/app_modules/katalog/component/button_header_right.tsx @@ -0,0 +1,44 @@ +"use client"; + +import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog"; +import ComponentGlobal_UI_Drawer from "@/app_modules/component_global/ui/ui_drawer"; +import { ActionIcon, Box } from "@mantine/core"; +import { useDisclosure } from "@mantine/hooks"; +import { + IconDots, + IconDotsVertical, + IconEdit, + IconPhotoEdit, + IconPolaroid, +} from "@tabler/icons-react"; +import { ComponentKatalog_DrawerKatalog } from "./drawer_katalog"; + +export function ComponentKatalog_ButtonHeaderRight({ + profileId, + userLoginId, + authorId, +}: { + profileId: string; + userLoginId: string; + authorId: string; +}) { + const [opened, { open, close }] = useDisclosure(); + + return ( + <> + {authorId !== userLoginId ? ( + + ) : ( + open()}> + + + )} + + close()} + profileId={profileId} + /> + + ); +} diff --git a/src/app_modules/katalog/component/drawer_katalog.tsx b/src/app_modules/katalog/component/drawer_katalog.tsx new file mode 100644 index 00000000..135837f0 --- /dev/null +++ b/src/app_modules/katalog/component/drawer_katalog.tsx @@ -0,0 +1,118 @@ +import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog"; +import Component_Logout from "@/app_modules/auth/logout/view"; +import { AccentColor } from "@/app_modules/component_global/color/color_pallet"; +import ComponentGlobal_UI_Loader from "@/app_modules/component_global/ui/ui_loader"; +import { + ActionIcon, + Drawer, + Group, + SimpleGrid, + Stack, + Text, +} from "@mantine/core"; +import { + IconEdit, + IconLogout, + IconLogout2, + IconPhotoEdit, + IconPolaroid, + IconX, +} from "@tabler/icons-react"; +import { useRouter } from "next/navigation"; +import { useState } from "react"; + +export function ComponentKatalog_DrawerKatalog({ + opened, + close, + profileId, +}: { + opened: boolean; + close: () => void; + profileId: string; +}) { + const router = useRouter(); + const [pageId, setPageId] = useState(""); + const [isLoading, setIsLoading] = useState(false); + + const listPage = [ + { + id: "1", + name: "Edit profile", + icon: , + path: RouterProfile.edit + profileId, + }, + { + id: "2", + name: "Ubah Foto Profile", + icon: , + path: RouterProfile.update_foto_profile + profileId, + }, + { + id: "3", + name: "Ubah Latar Belakang", + icon: , + path: RouterProfile.update_foto_background + profileId, + }, + ]; + + return ( + <> + close()} + position={"bottom"} + size={"auto"} + withCloseButton={false} + styles={{ + content: { + padding: 0, + position: "absolute", + margin: "auto", + backgroundColor: "transparent", + left: 0, + right: 0, + width: 500, + }, + body: { + backgroundColor: AccentColor.darkblue, + borderTop: `2px solid ${AccentColor.blue}`, + borderRight: `1px solid ${AccentColor.blue}`, + borderLeft: `1px solid ${AccentColor.blue}`, + borderRadius: "20px 20px 0px 0px", + color: "white", + paddingBottom: "5%", + }, + }} + > + + + + + + + + {listPage.map((e, i) => ( + + { + router.push(e.path); + setPageId(e?.id); + setIsLoading(true) + }} + > + {isLoading && e.id === pageId ? : e.icon} + + + {e.name} + + + ))} + + + + + + ); +} diff --git a/src/app_modules/katalog/index.ts b/src/app_modules/katalog/index.ts index 215b6612..c95adbb5 100644 --- a/src/app_modules/katalog/index.ts +++ b/src/app_modules/katalog/index.ts @@ -1,3 +1,4 @@ import HeaderTransparent from "./component/header_transparent"; -export {HeaderTransparent as headerTransparent} \ No newline at end of file +export { HeaderTransparent as headerTransparent }; +export { Katalog_MainView } from "./view_katalog"; diff --git a/src/app_modules/katalog/main/index.ts b/src/app_modules/katalog/main/index.ts index e1ebf6e6..793e49ee 100644 --- a/src/app_modules/katalog/main/index.ts +++ b/src/app_modules/katalog/main/index.ts @@ -1,4 +1,3 @@ -import KatalogView from "./view"; import KatalogLayout from "./layout"; -export {KatalogView, KatalogLayout} \ No newline at end of file +export { KatalogLayout }; diff --git a/src/app_modules/katalog/main/layout.tsx b/src/app_modules/katalog/main/layout.tsx index f6707ee2..5ee0d691 100644 --- a/src/app_modules/katalog/main/layout.tsx +++ b/src/app_modules/katalog/main/layout.tsx @@ -1,103 +1,38 @@ "use client"; -import { Logout } from "@/app_modules/auth"; -import { - ActionIcon, - AppShell, - Group, - Header, - Text, - Title, -} from "@mantine/core"; -import { - IconUserSearch, - IconAward, - IconQrcode, - IconArrowLeft, - IconPencilPlus, - IconChevronLeft, - IconDashboard, -} from "@tabler/icons-react"; -import { useRouter } from "next/navigation"; -import ComponentKatalog_HeaderTamplate from "../component/header_tamplate"; -import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog"; -import { RouterHome } from "@/app/lib/router_hipmi/router_home"; -import { title } from "process"; -import { RouterAdminDashboard } from "@/app/lib/router_hipmi/router_admin"; -import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate"; +import UIGlobal_LayoutHeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate"; +import UIGlobal_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; +import { ComponentKatalog_ButtonHeaderRight } from "../component/button_header_right"; export default function KatalogLayout({ children, profileId, + userLoginId, + authorId, }: { children: any; profileId: any; + userLoginId: string; + authorId: string; }) { - const router = useRouter(); - return ( <> - - - { - router.back(); - }} - > - - - - Katalog - - - {/* router.push(RouterAdminDashboard.splash_admin)} - > - - */} - - + + } + /> } > {children} - - - ); - - return ( - <> - - - { - router.back(); - }} - > - - - - Katalog - - - {/* router.push(RouterAdminDashboard.splash_admin)} - > - - */} - - - } - > - {children} - + ); } diff --git a/src/app_modules/katalog/main/view.tsx b/src/app_modules/katalog/main/view.tsx deleted file mode 100644 index ae6263ce..00000000 --- a/src/app_modules/katalog/main/view.tsx +++ /dev/null @@ -1,49 +0,0 @@ -"use client"; - -import { Warna } from "@/app/lib/warna"; -import { - ActionIcon, - BackgroundImage, - Box, - Center, - Flex, - Grid, - Group, - Image, - Paper, - Stack, - Text, -} from "@mantine/core"; -import { ProfileView } from "../profile"; -import { ListPortofolioView } from "../portofolio"; -import { MODEL_PROFILE_OLD } from "@/app_modules/home/model/user_profile"; -import { MODEL_PORTOFOLIO_Lama } from "@/app_modules/model_global/portofolio"; -import User_Logout from "@/app_modules/auth/logout/view"; -import { MODEL_PORTOFOLIO } from "../portofolio/model/interface"; -import { MODEL_PROFILE } from "../profile/model/interface"; - -export default function KatalogView({ - profile, - listPorto, - userLoginId, -}: { - profile: MODEL_PROFILE; - listPorto: MODEL_PORTOFOLIO; - userLoginId: string; -}) { - return ( - <> - - - - - {profile?.User.id === userLoginId ? : ""} - - - - ); -} diff --git a/src/app_modules/katalog/portofolio/component/button_delete.tsx b/src/app_modules/katalog/portofolio/component/button_delete.tsx new file mode 100644 index 00000000..10e552a3 --- /dev/null +++ b/src/app_modules/katalog/portofolio/component/button_delete.tsx @@ -0,0 +1,80 @@ +import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil"; +import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal"; +import { Button, Group, Modal, Stack, Title } from "@mantine/core"; +import { IconTrash } from "@tabler/icons-react"; +import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime"; +import router from "next/router"; +import { useState } from "react"; +import { Portofolio_funDeletePortofolioById } from "../fun/delete/fun_delete_by_id"; +import { MODEL_PORTOFOLIO } from "../model/interface"; +import { useRouter } from "next/navigation"; +import ComponentGlobal_UI_Modal from "@/app_modules/component_global/ui/ui_modal"; + +export function ComponentPortofolio_ButtonDelete({ + userLoginId, + dataPorto, +}: { + userLoginId: string; + dataPorto: MODEL_PORTOFOLIO; +}) { + const router = useRouter(); + const [openModal, setModal] = useState(false); + const [loadingDel, setLoadingDel] = useState(false); + + return ( + <> + {userLoginId === dataPorto?.Profile.userId ? ( + + ) : ( + "" + )} + + setModal(false)} + buttonKiri={ + + } + buttonKanan={ + + } + /> + + ); +} + +async function onDelete( + router: AppRouterInstance, + dataPorto: MODEL_PORTOFOLIO, + setLoadingDel: any +) { + await Portofolio_funDeletePortofolioById(dataPorto).then((res) => { + if (res.status === 200) { + setLoadingDel(true); + ComponentGlobal_NotifikasiBerhasil(res.message); + router.back(); + } else { + ComponentGlobal_NotifikasiGagal(res.message); + } + }); +} diff --git a/src/app_modules/katalog/portofolio/component/button_more.tsx b/src/app_modules/katalog/portofolio/component/button_more.tsx new file mode 100644 index 00000000..590dc835 --- /dev/null +++ b/src/app_modules/katalog/portofolio/component/button_more.tsx @@ -0,0 +1,64 @@ +"use client"; + +import { RouterPortofolio } from "@/app/lib/router_hipmi/router_katalog"; +import ComponentGlobal_UI_Drawer from "@/app_modules/component_global/ui/ui_drawer"; +import { ActionIcon } from "@mantine/core"; +import { + IconDots, + IconDotsVertical, + IconEdit, + IconId, + IconPhotoEdit, +} from "@tabler/icons-react"; +import { useRouter } from "next/navigation"; +import { useState } from "react"; + +export function ComponentPortofolio_ButtonMore({ + portoId, + userLoginId, + authorId, +}: { + portoId: string; + userLoginId: string; + authorId: string; +}) { + const [openDrawer, setOpenDrawer] = useState(false); + const listPage = [ + { + id: "1", + name: "Update detail bisnis", + icon: , + path: RouterPortofolio.edit_data_bisnis + `${portoId}`, + }, + { + id: "2", + name: "Update logo ", + icon: , + path: RouterPortofolio.edit_logo_bisnis + `${portoId}`, + }, + { + id: "3", + name: "Update sosial media", + icon: , + path: RouterPortofolio.edit_medsos_bisnis + `${portoId}`, + }, + ]; + + return ( + <> + {userLoginId === authorId ? ( + setOpenDrawer(true)}> + + + ) : ( + + )} + + setOpenDrawer(false)} + component={listPage} + /> + + ); +} diff --git a/src/app_modules/katalog/portofolio/component/card_view_daftar.tsx b/src/app_modules/katalog/portofolio/component/card_view_daftar.tsx new file mode 100644 index 00000000..4dca5bd8 --- /dev/null +++ b/src/app_modules/katalog/portofolio/component/card_view_daftar.tsx @@ -0,0 +1,50 @@ +import { Group, Paper, Stack, Text } from "@mantine/core"; +import { MODEL_PORTOFOLIO } from "../model/interface"; +import { AccentColor } from "@/app_modules/component_global/color/color_pallet"; +import ComponentGlobal_UI_Loader from "@/app_modules/component_global/ui/ui_loader"; +import { IconCaretRight } from "@tabler/icons-react"; +import { useRouter } from "next/navigation"; +import { useState } from "react"; +import { RouterPortofolio } from "@/app/lib/router_hipmi/router_katalog"; + +export function ComponentPortofolio_DaftarBoxView({ + data, +}: { + data: MODEL_PORTOFOLIO; +}) { + const router = useRouter(); + const [isLoading, setIsLoading] = useState(false); + return ( + <> + { + setIsLoading(true); + router.push(RouterPortofolio.main_detail + data.id); + }} + style={{ + backgroundColor: AccentColor.darkblue, + border: `2px solid ${AccentColor.blue}`, + borderRadius: "10px ", + padding: "15px", + color: "white", + }} + > + + + {data?.namaBisnis} + + + {isLoading ? ( + + ) : ( + + )} + + + + + ); +} diff --git a/src/app_modules/katalog/portofolio/create/layout.tsx b/src/app_modules/katalog/portofolio/create/layout.tsx index b4165cf3..4bb550c7 100644 --- a/src/app_modules/katalog/portofolio/create/layout.tsx +++ b/src/app_modules/katalog/portofolio/create/layout.tsx @@ -1,22 +1,18 @@ "use client"; -import { ActionIcon, AppShell, Group, Header, Text } from "@mantine/core"; -import { IconArrowLeft } from "@tabler/icons-react"; -import { useRouter } from "next/navigation"; -import ComponentKatalog_HeaderTamplate from "../../component/header_tamplate"; -import AppComponentGlobal_LayoutTamplate from "@/app_modules/component_global/component_layout_tamplate"; +import UIGlobal_LayoutHeaderTamplate from "@/app_modules/component_global/ui/ui_header_tamplate"; +import UIGlobal_LayoutTamplate from "@/app_modules/component_global/ui/ui_layout_tamplate"; export default function CreatePortofolioLayout({ children, profileId }: { children: any, profileId: any }) { - const router = useRouter(); return ( <> - + } > {children} - + ); } diff --git a/src/app_modules/katalog/portofolio/create/view.tsx b/src/app_modules/katalog/portofolio/create/view.tsx index 33326b5d..f220efd9 100644 --- a/src/app_modules/katalog/portofolio/create/view.tsx +++ b/src/app_modules/katalog/portofolio/create/view.tsx @@ -1,8 +1,11 @@ "use client"; -import { myConsole } from "@/app/fun/my_console"; -import { ApiHipmi } from "@/app/lib/api"; import { Warna } from "@/app/lib/warna"; +import ComponentGlobal_ErrorInput from "@/app_modules/component_global/error_input"; +import ComponentGlobal_InputCountDown from "@/app_modules/component_global/input_countdown"; +import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil"; +import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal"; +import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan"; import { BIDANG_BISNIS_OLD, MODEL_PORTOFOLIO_OLD, @@ -16,25 +19,21 @@ import { Paper, Select, Stack, - Text, TextInput, Textarea, - Title, } from "@mantine/core"; +import { IconCamera } from "@tabler/icons-react"; import _ from "lodash"; +import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime"; import { useRouter } from "next/navigation"; import { useState } from "react"; -import toast from "react-simple-toasts"; -import funCreatePortofolio from "../fun/fun_create_portofolio"; -import { IconCamera } from "@tabler/icons-react"; import ComponentKatalog_NotedBox from "../../component/noted_box"; -import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime"; -import { NotifPeringatan } from "@/app_modules/donasi/component/notifikasi/notif_peringatan"; -import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil"; -import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal"; -import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan"; -import ComponentGlobal_ErrorInput from "@/app_modules/component_global/error_input"; -import ComponentGlobal_InputCountDown from "@/app_modules/component_global/input_countdown"; +import funCreatePortofolio from "../fun/fun_create_portofolio"; +import ComponentGlobal_BoxInformation from "@/app_modules/component_global/box_information"; +import { + AccentColor, + MainColor, +} from "@/app_modules/component_global/color/color_pallet"; export default function CreatePortofolio({ bidangBisnis, @@ -69,10 +68,15 @@ export default function CreatePortofolio({ <> {/* {JSON.stringify(profileId)} */} - + - +