diff --git a/package.json b/package.json index 7ff6d7fc..90d5bef6 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,7 @@ "react-countdown": "^2.3.5", "react-dom": "18.2.0", "react-fast-marquee": "^1.6.4", + "react-icons": "^5.0.1", "react-international-phone": "^4.2.6", "react-quill": "^2.0.0", "react-responsive-carousel": "^3.2.23", diff --git a/public/aset/forum/logo.png b/public/aset/forum/logo.png new file mode 100644 index 00000000..ced44c9c Binary files /dev/null and b/public/aset/forum/logo.png differ diff --git a/src/app/dev/event/main/loading.tsx b/src/app/dev/event/main/loading.tsx index 0db19fa0..b1f8b62f 100644 --- a/src/app/dev/event/main/loading.tsx +++ b/src/app/dev/event/main/loading.tsx @@ -1,9 +1,9 @@ -import ComponentGlobal_LoadingPage from "@/app_modules/component_global/loading_page"; +import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2"; export default async function Page() { - return ( - <> - - - ); -} \ No newline at end of file + return ( + <> + + + ); +} diff --git a/src/app/dev/event/splash/loading.tsx b/src/app/dev/event/splash/loading.tsx index ab5335df..b1f8b62f 100644 --- a/src/app/dev/event/splash/loading.tsx +++ b/src/app/dev/event/splash/loading.tsx @@ -1,9 +1,9 @@ -import ComponentGlobal_LoadingPage from "@/app_modules/component_global/loading_page"; +import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2"; export default async function Page() { - return ( - <> - - - ); -} \ No newline at end of file + return ( + <> + + + ); +} diff --git a/src/app/dev/forum/create/layout.tsx b/src/app/dev/forum/create/layout.tsx new file mode 100644 index 00000000..322d1e25 --- /dev/null +++ b/src/app/dev/forum/create/layout.tsx @@ -0,0 +1,14 @@ +import { LayoutForum_Create } from "@/app_modules/forum"; +import React from "react"; + +export default async function Layout({ + children, +}: { + children: React.ReactNode; +}) { + return ( + <> + {children} + + ); +} diff --git a/src/app/dev/forum/create/page.tsx b/src/app/dev/forum/create/page.tsx new file mode 100644 index 00000000..68e10889 --- /dev/null +++ b/src/app/dev/forum/create/page.tsx @@ -0,0 +1,9 @@ +import { Forum_Create } from "@/app_modules/forum"; + +export default async function Page() { + return ( + <> + + + ); +} diff --git a/src/app/dev/forum/detail/[id]/layout.tsx b/src/app/dev/forum/detail/[id]/layout.tsx new file mode 100644 index 00000000..01a3eab5 --- /dev/null +++ b/src/app/dev/forum/detail/[id]/layout.tsx @@ -0,0 +1,14 @@ +import LayoutForum_Detail from "@/app_modules/forum/detail/layout"; +import React from "react"; + +export default async function Layout({ + children, +}: { + children: React.ReactNode; +}) { + return ( + <> + {children} + + ); +} diff --git a/src/app/dev/forum/detail/[id]/loading.tsx b/src/app/dev/forum/detail/[id]/loading.tsx new file mode 100644 index 00000000..b1f8b62f --- /dev/null +++ b/src/app/dev/forum/detail/[id]/loading.tsx @@ -0,0 +1,9 @@ +import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2"; + +export default async function Page() { + return ( + <> + + + ); +} diff --git a/src/app/dev/forum/detail/[id]/page.tsx b/src/app/dev/forum/detail/[id]/page.tsx new file mode 100644 index 00000000..e996b30f --- /dev/null +++ b/src/app/dev/forum/detail/[id]/page.tsx @@ -0,0 +1,11 @@ +import Forum_Detail from "@/app_modules/forum/detail"; + +export default async function Page({params}: {params: {id: string}}) { + let forumId = params.id + + return ( + <> + + + ); +} diff --git a/src/app/dev/forum/edit/komentar/[id]/layout.tsx b/src/app/dev/forum/edit/komentar/[id]/layout.tsx new file mode 100644 index 00000000..e2e6984c --- /dev/null +++ b/src/app/dev/forum/edit/komentar/[id]/layout.tsx @@ -0,0 +1,14 @@ +import { LaoyoutForum_EditKomentar } from "@/app_modules/forum"; +import React from "react"; + +export default async function Layout({ + children, +}: { + children: React.ReactNode; +}) { + return ( + <> + {children} + + ); +} diff --git a/src/app/dev/forum/edit/komentar/[id]/page.tsx b/src/app/dev/forum/edit/komentar/[id]/page.tsx new file mode 100644 index 00000000..d7178b96 --- /dev/null +++ b/src/app/dev/forum/edit/komentar/[id]/page.tsx @@ -0,0 +1,10 @@ +import { Forum_EditKomentar } from "@/app_modules/forum"; + +export default async function Page({ params }: { params: { id: string } }) { + let komentarId = params.id; + return ( + <> + + + ); +} diff --git a/src/app/dev/forum/edit/posting/[id]/layout.tsx b/src/app/dev/forum/edit/posting/[id]/layout.tsx new file mode 100644 index 00000000..058935bd --- /dev/null +++ b/src/app/dev/forum/edit/posting/[id]/layout.tsx @@ -0,0 +1,15 @@ + +import { LayoutForum_EditPosting } from "@/app_modules/forum"; +import React from "react"; + +export default async function Layout({ + children, +}: { + children: React.ReactNode; +}) { + return ( + <> + {children} + + ); +} diff --git a/src/app/dev/forum/edit/posting/[id]/page.tsx b/src/app/dev/forum/edit/posting/[id]/page.tsx new file mode 100644 index 00000000..507f4995 --- /dev/null +++ b/src/app/dev/forum/edit/posting/[id]/page.tsx @@ -0,0 +1,9 @@ +import { Forum_EditPosting } from "@/app_modules/forum"; + +export default async function Page() { + return ( + <> + + + ); +} diff --git a/src/app/dev/forum/forumku/[id]/layout.tsx b/src/app/dev/forum/forumku/[id]/layout.tsx new file mode 100644 index 00000000..35e7309d --- /dev/null +++ b/src/app/dev/forum/forumku/[id]/layout.tsx @@ -0,0 +1,21 @@ +import { LayoutForum_Forumku } from "@/app_modules/forum"; +import { User_getUserId } from "@/app_modules/fun_global/get_user_token"; +import { user_getOneById } from "@/app_modules/home/fun/get/get_one_user_by_id"; +import React from "react"; + +export default async function Layout({ + children, +}: { + children: React.ReactNode; +}) { + const authorId = await User_getUserId(); + const dataAuthor = await user_getOneById(authorId); + + return ( + <> + + {children} + + + ); +} diff --git a/src/app/dev/forum/forumku/[id]/loading.tsx b/src/app/dev/forum/forumku/[id]/loading.tsx new file mode 100644 index 00000000..b1f8b62f --- /dev/null +++ b/src/app/dev/forum/forumku/[id]/loading.tsx @@ -0,0 +1,9 @@ +import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2"; + +export default async function Page() { + return ( + <> + + + ); +} diff --git a/src/app/dev/forum/forumku/[id]/page.tsx b/src/app/dev/forum/forumku/[id]/page.tsx new file mode 100644 index 00000000..73a22f63 --- /dev/null +++ b/src/app/dev/forum/forumku/[id]/page.tsx @@ -0,0 +1,29 @@ +import { Forum_Forumku } from "@/app_modules/forum"; +import { User_getUserId } from "@/app_modules/fun_global/get_user_token"; +import { user_getOneById } from "@/app_modules/home/fun/get/get_one_user_by_id"; +import _ from "lodash"; + +export default async function Page({ params }: { params: { id: string } }) { + const authorId = params.id; + const dataAuthor = await user_getOneById(authorId); + const auhtorSelectedData = _.omit(dataAuthor, [ + "Profile.email", + "Profile.alamat", + "Profile.jenisKelamin", + "Profile.createdAt", + "Profile.updatedAt", + "Profile.imagesBackgroundId", + ]); + // console.log(dataAuthor) + // console.log(auhtorSelectedData) + + // await new Promise((a, b) => { + // setTimeout(a, 1000); + // }); + + return ( + <> + + + ); +} diff --git a/src/app/dev/forum/komentar/[id]/layout.tsx b/src/app/dev/forum/komentar/[id]/layout.tsx new file mode 100644 index 00000000..3ce7ca84 --- /dev/null +++ b/src/app/dev/forum/komentar/[id]/layout.tsx @@ -0,0 +1,8 @@ +import { LayoutForum_Komentar } from "@/app_modules/forum"; +import React from "react"; + +export default async function Layout({children}: {children: React.ReactNode}) { + return<> + {children} + +} \ No newline at end of file diff --git a/src/app/dev/forum/komentar/[id]/page.tsx b/src/app/dev/forum/komentar/[id]/page.tsx new file mode 100644 index 00000000..61bc1465 --- /dev/null +++ b/src/app/dev/forum/komentar/[id]/page.tsx @@ -0,0 +1,12 @@ +import { Forum_Komentar } from "@/app_modules/forum"; + +export default async function Page({params}: {params: {id: string}}) { + let forumId = params.id + + + return ( + <> + + + ); +} diff --git a/src/app/dev/forum/main/layout.tsx b/src/app/dev/forum/main/layout.tsx new file mode 100644 index 00000000..4587098b --- /dev/null +++ b/src/app/dev/forum/main/layout.tsx @@ -0,0 +1,19 @@ +import { LayoutForum_Main } from "@/app_modules/forum"; +import { User_getUserId } from "@/app_modules/fun_global/get_user_token"; +import { user_getOneById } from "@/app_modules/home/fun/get/get_one_user_by_id"; +import React from "react"; + +export default async function Layout({ + children, +}: { + children: React.ReactNode; +}) { + const authorId = await User_getUserId(); + const dataAuthor = await user_getOneById(authorId); + + return ( + <> + {children} + + ); +} diff --git a/src/app/dev/forum/main/loading.tsx b/src/app/dev/forum/main/loading.tsx new file mode 100644 index 00000000..874bc4a9 --- /dev/null +++ b/src/app/dev/forum/main/loading.tsx @@ -0,0 +1,9 @@ +import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2"; + +export default async function Page() { + return ( + <> + + + ); +} diff --git a/src/app/dev/forum/main/page.tsx b/src/app/dev/forum/main/page.tsx new file mode 100644 index 00000000..b204a95b --- /dev/null +++ b/src/app/dev/forum/main/page.tsx @@ -0,0 +1,9 @@ +import { Forum_Beranda } from "@/app_modules/forum"; + +export default async function Page() { + return ( + <> + + + ); +} diff --git a/src/app/dev/forum/report/komentar/[id]/layout.tsx b/src/app/dev/forum/report/komentar/[id]/layout.tsx new file mode 100644 index 00000000..c20223e0 --- /dev/null +++ b/src/app/dev/forum/report/komentar/[id]/layout.tsx @@ -0,0 +1,14 @@ +import { LayoutForum_ReportKomentar } from "@/app_modules/forum"; +import React from "react"; + +export default async function Layout({ + children, +}: { + children: React.ReactNode; +}) { + return ( + <> + {children} + + ); +} diff --git a/src/app/dev/forum/report/komentar/[id]/loading.tsx b/src/app/dev/forum/report/komentar/[id]/loading.tsx new file mode 100644 index 00000000..b1f8b62f --- /dev/null +++ b/src/app/dev/forum/report/komentar/[id]/loading.tsx @@ -0,0 +1,9 @@ +import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2"; + +export default async function Page() { + return ( + <> + + + ); +} diff --git a/src/app/dev/forum/report/komentar/[id]/page.tsx b/src/app/dev/forum/report/komentar/[id]/page.tsx new file mode 100644 index 00000000..4d438530 --- /dev/null +++ b/src/app/dev/forum/report/komentar/[id]/page.tsx @@ -0,0 +1,8 @@ +import { Forum_ReportKomentar } from "@/app_modules/forum"; + +export default async function Page({params}: {params: {id: string}}) { + let komentarId = params.id + return<> + + +} \ No newline at end of file diff --git a/src/app/dev/forum/report/posting/[id]/layout.tsx b/src/app/dev/forum/report/posting/[id]/layout.tsx new file mode 100644 index 00000000..b4cdf878 --- /dev/null +++ b/src/app/dev/forum/report/posting/[id]/layout.tsx @@ -0,0 +1,15 @@ + +import { LayoutForum_ReportPosting } from "@/app_modules/forum"; +import React from "react"; + +export default async function Layout({ + children, +}: { + children: React.ReactNode; +}) { + return ( + <> + {children} + + ); +} diff --git a/src/app/dev/forum/report/posting/[id]/loading.tsx b/src/app/dev/forum/report/posting/[id]/loading.tsx new file mode 100644 index 00000000..b1f8b62f --- /dev/null +++ b/src/app/dev/forum/report/posting/[id]/loading.tsx @@ -0,0 +1,9 @@ +import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2"; + +export default async function Page() { + return ( + <> + + + ); +} diff --git a/src/app/dev/forum/report/posting/[id]/page.tsx b/src/app/dev/forum/report/posting/[id]/page.tsx new file mode 100644 index 00000000..3e1672d5 --- /dev/null +++ b/src/app/dev/forum/report/posting/[id]/page.tsx @@ -0,0 +1,11 @@ +import { Forum_ReportPosting } from "@/app_modules/forum"; + +export default async function Page({ params }: { params: { id: string } }) { + let id = params.id; + + return ( + <> + + + ); +} diff --git a/src/app/dev/forum/splash/page.tsx b/src/app/dev/forum/splash/page.tsx new file mode 100644 index 00000000..db8e7cda --- /dev/null +++ b/src/app/dev/forum/splash/page.tsx @@ -0,0 +1,9 @@ +import { Forum_Splash } from "@/app_modules/forum"; + +export default async function Page() { + return ( + <> + + + ); +} diff --git a/src/app/dev/home/layout.tsx b/src/app/dev/home/layout.tsx index e2cf3dee..e43dc67f 100644 --- a/src/app/dev/home/layout.tsx +++ b/src/app/dev/home/layout.tsx @@ -1,11 +1,11 @@ import { User_getUserId } from "@/app_modules/fun_global/get_user_token"; import { HomeLayout } from "@/app_modules/home"; -import { User_getOneById } from "@/app_modules/home/fun/get/get_one_user_by_id"; +import { user_getOneById } from "@/app_modules/home/fun/get/get_one_user_by_id"; import { redirect } from "next/navigation"; export default async function Layout({ children }: { children: any }) { const userId = await User_getUserId(); - const dataUser = await User_getOneById(userId); + const dataUser = await user_getOneById(userId); return ( <> diff --git a/src/app/dev/home/loading.tsx b/src/app/dev/home/loading.tsx index 6d21ef97..b1f8b62f 100644 --- a/src/app/dev/home/loading.tsx +++ b/src/app/dev/home/loading.tsx @@ -1,9 +1,9 @@ -import ComponentGlobal_LoadingPage from "@/app_modules/component_global/loading_page"; +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 146fb60d..477453b1 100644 --- a/src/app/dev/home/page.tsx +++ b/src/app/dev/home/page.tsx @@ -3,11 +3,11 @@ import { cookies } from "next/headers"; import { unsealData } from "iron-session"; import _ from "lodash"; import { User_getUserId } from "@/app_modules/fun_global/get_user_token"; -import { User_getOneById } from "@/app_modules/home/fun/get/get_one_user_by_id"; +import { user_getOneById } from "@/app_modules/home/fun/get/get_one_user_by_id"; export default async function Page() { const userId = await User_getUserId(); - const dataUser = await User_getOneById(userId); + const dataUser = await user_getOneById(userId); // await new Promise((a, b) => { // setTimeout(a, 1000); // }); diff --git a/src/app/dev/katalog/[id]/loading.tsx b/src/app/dev/katalog/[id]/loading.tsx index 843e1ee7..b1f8b62f 100644 --- a/src/app/dev/katalog/[id]/loading.tsx +++ b/src/app/dev/katalog/[id]/loading.tsx @@ -1,10 +1,9 @@ -import ComponentGlobal_LoadingPage from "@/app_modules/component_global/loading_page"; +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 97148afd..bba193be 100644 --- a/src/app/dev/katalog/[id]/page.tsx +++ b/src/app/dev/katalog/[id]/page.tsx @@ -12,13 +12,13 @@ import { funGetListPortofolio } from "@/app_modules/katalog/portofolio/fun/get/g import { User_getUserId } from "@/app_modules/fun_global/get_user_token"; import { Profile_getOneById } from "@/app_modules/katalog/profile/fun/get/get_one_profile"; import { Profile_getOneProfileAndUserById } from "@/app_modules/katalog/profile/fun/get/get_one_user_profile"; -import { User_getOneById } from "@/app_modules/home/fun/get/get_one_user_by_id"; +import { user_getOneById } 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_getUserId(); - const dataUser = await User_getOneById(authorId) + const dataUser = await user_getOneById(authorId) const listPorto = await funGetListPortofolio(profileId); const dataProfile = await Profile_getOneProfileAndUserById(profileId); // console.log(dataProfile) diff --git a/src/app/lib/router_hipmi/router_forum.ts b/src/app/lib/router_hipmi/router_forum.ts new file mode 100644 index 00000000..2870676a --- /dev/null +++ b/src/app/lib/router_hipmi/router_forum.ts @@ -0,0 +1,24 @@ +export const RouterForum = { + splash: "/dev/forum/splash", + + // main + beranda: "/dev/forum/main", + forumku: "/dev/forum/forumku/", + + // create + create: "/dev/forum/create", + + //edit + edit_posting: "/dev/forum/edit/posting/", + edit_komentar: "/dev/forum/edit/komentar/", + + //detail + main_detail: "/dev/forum/detail/", + + // komentra + komentar: "/dev/forum/komentar/", + + //report + report_posting: "/dev/forum/report/posting/", + report_komentar: "/dev/forum/report/komentar/", +}; diff --git a/src/app_modules/component_global/author_name_on_header.tsx b/src/app_modules/component_global/author_name_on_header.tsx index a6a42a24..995b429c 100644 --- a/src/app_modules/component_global/author_name_on_header.tsx +++ b/src/app_modules/component_global/author_name_on_header.tsx @@ -1,20 +1,26 @@ "use client"; import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog"; -import { Stack, Grid, Avatar, Divider, Text } from "@mantine/core"; +import { Stack, Grid, Avatar, Divider, Text, Group } from "@mantine/core"; import { useRouter } from "next/navigation"; import { ComponentGlobal_NotifikasiPeringatan } from "./notif_global/notifikasi_peringatan"; +import moment from "moment"; export default function ComponentGlobal_AuthorNameOnHeader({ profileId, imagesId, authorName, + tglPublish, + isPembatas, }: { profileId?: string; imagesId?: string; authorName?: string; + tglPublish?: Date; + isPembatas?: boolean; }) { const router = useRouter(); + const skrng = new Date(); return ( <> @@ -43,13 +49,28 @@ export default function ComponentGlobal_AuthorNameOnHeader({ - - {authorName ? authorName : "Nama author"} - + + + + {authorName ? authorName : "Nama author"} + + + + {tglPublish ? ( + + {skrng.toLocaleDateString(["id-ID"], { + dateStyle: "medium", + })} + + ) : ( + "" + )} + + - + {isPembatas ? : ""} ); diff --git a/src/app_modules/component_global/loading_page.tsx b/src/app_modules/component_global/loading_page.tsx deleted file mode 100644 index eade6600..00000000 --- a/src/app_modules/component_global/loading_page.tsx +++ /dev/null @@ -1,36 +0,0 @@ -"use client"; - -import { Center, Group, Loader, Skeleton, Stack } from "@mantine/core"; - -/** - * @param | is On Layout: 100%, is Not On Layout: 100vh - * @returns Skeleton loading - */ -export default function ComponentGlobal_LoadingPage({ height }: { height: string }) { - return ( - <> -
- - {Array(3) - .fill(0) - .map((e, i) => ( - - ))} - - {/* - {Array(3) - .fill(0) - .map((v, index) => ( - - {Array(3) - .fill(0) - .map((e, i) => ( - - ))} - - ))} - */} -
- - ); -} diff --git a/src/app_modules/component_global/loading_page_v2.tsx b/src/app_modules/component_global/loading_page_v2.tsx new file mode 100644 index 00000000..4ebb72fe --- /dev/null +++ b/src/app_modules/component_global/loading_page_v2.tsx @@ -0,0 +1,25 @@ +"use client"; + +import { Box, Center, Group, LoadingOverlay, Skeleton } from "@mantine/core"; + +export default function ComponentGlobal_V2_LoadingPage() { + const customLOader = ( +
+ + {Array(3) + .fill(0) + .map((e, i) => ( + + ))} + +
+ ); + + return ( + <> + + + + + ); +} diff --git a/src/app_modules/forum/component/author_header_name.tsx b/src/app_modules/forum/component/author_header_name.tsx new file mode 100644 index 00000000..d474a001 --- /dev/null +++ b/src/app_modules/forum/component/author_header_name.tsx @@ -0,0 +1,133 @@ +"use client"; + +import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog"; +import { + Stack, + Grid, + Avatar, + Divider, + Text, + Group, + ThemeIcon, + ActionIcon, + Drawer, + Paper, + Button, + Modal, + Title, +} from "@mantine/core"; +import { useRouter } from "next/navigation"; +import moment from "moment"; +import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan"; +import { RouterForum } from "@/app/lib/router_hipmi/router_forum"; +import { + IconCircleFilled, + IconDots, + IconEdit, + IconFlag3, + IconMessageCircle, + IconTrash, +} from "@tabler/icons-react"; +import { IconCircle } from "@tabler/icons-react"; +import { IoIosMore } from "react-icons/io"; +import { useDisclosure } from "@mantine/hooks"; +import { useState } from "react"; +import ButtonMore from "./button_more"; + +export default function ComponentForum_AuthorNameOnHeader({ + forumId, + imagesId, + authorName, + username, + tglPublish, + isPembatas, + tipe, + isMoreButton, +}: { + forumId?: string; + imagesId?: string; + authorName?: string; + username?: string; + tglPublish?: Date; + isPembatas?: boolean; + tipe: string; + isMoreButton?: boolean; +}) { + const router = useRouter(); + const skrng = new Date(); + return ( + <> + + + { + if (forumId) { + router.push(RouterForum.forumku + forumId); + } else { + ComponentGlobal_NotifikasiPeringatan("Id tidak ditemukan"); + } + }} + > + + + + + + + + {authorName + ? authorName + : "Nama author coba di berikan panjang "} + + + {/* + + {username ? username : "@username "} + + */} + + + + + + + + + {skrng.toLocaleDateString(["id-ID"], { + // dateStyle: "medium", + day: "numeric", + month: "short", + })} + + + + {isMoreButton ? ( + + + + ) : ( + "" + )} + + + + {isPembatas ? : ""} + + + ); +} diff --git a/src/app_modules/forum/component/author_name_on_detail.tsx b/src/app_modules/forum/component/author_name_on_detail.tsx new file mode 100644 index 00000000..13d9297a --- /dev/null +++ b/src/app_modules/forum/component/author_name_on_detail.tsx @@ -0,0 +1,114 @@ +"use client"; + +import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog"; +import { + Stack, + Grid, + Avatar, + Divider, + Text, + Group, + ThemeIcon, + ActionIcon, +} from "@mantine/core"; +import { useRouter } from "next/navigation"; +import moment from "moment"; +import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan"; +import { RouterForum } from "@/app/lib/router_hipmi/router_forum"; +import { + IconCircleFilled, + IconDots, + IconMessageCircle, +} from "@tabler/icons-react"; +import { IconCircle } from "@tabler/icons-react"; +import ButtonMore from "./button_more"; + +export default function ComponentForum_AuthorNameOnDetail({ + forumId, + imagesId, + authorName, + username, + tglPublish, + isPembatas, + tipe, +}: { + forumId?: string; + imagesId?: string; + authorName?: string; + username?: string; + tglPublish?: Date; + isPembatas?: boolean; + tipe: string +}) { + const router = useRouter(); + const skrng = new Date(); + return ( + <> + + + { + if (forumId) { + router.push(RouterForum.forumku + forumId); + } else { + ComponentGlobal_NotifikasiPeringatan("Id tidak ditemukan"); + } + }} + > + + + + + + {authorName ? authorName : "Nama author "} + + + {username ? username : "@username "} + + + + {/* + + + + {authorName ? authorName : "Nama author "} + + + + + {username ? username : "@username "} + + + + + + + {skrng.toLocaleDateString(["id-ID"], { + dateStyle: "medium", + })} + + + + + */} + + + + + + {isPembatas ? : ""} + + + ); +} diff --git a/src/app_modules/forum/component/button_more.tsx b/src/app_modules/forum/component/button_more.tsx new file mode 100644 index 00000000..285f8c4e --- /dev/null +++ b/src/app_modules/forum/component/button_more.tsx @@ -0,0 +1,172 @@ +"use client"; + +import { RouterForum } from "@/app/lib/router_hipmi/router_forum"; +import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil"; +import { + Drawer, + Stack, + Grid, + Button, + Modal, + Title, + Group, + ActionIcon, + Text, + Box, + Center, + Loader, +} from "@mantine/core"; +import { useDisclosure } from "@mantine/hooks"; +import { IconTrash, IconEdit, IconFlag3, IconDots } from "@tabler/icons-react"; +import { useRouter } from "next/navigation"; +import { useState } from "react"; + +import { createStyles } from "@mantine/core"; +import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2"; +import { useAtom } from "jotai"; +import { gs_forum_loading_edit_posting } from "../global_state"; +import ComponentForum_LoadingDrawer from "./loading_drawer"; + +const useStyles = createStyles((theme) => ({ + myCustomButton: { + ...theme.fn.focusStyles(), + }, + radiusCustom: { + // borderRadius: "10px, 10px, 0px,0px", + borderTopRightRadius: "10px", + borderTopLeftRadius: "10px", + }, +})); + +export default function ButtonMore({ id, tipe }: { id: any; tipe: string }) { + const router = useRouter(); + const { classes } = useStyles(); + const [opened, { open, close }] = useDisclosure(false); + const [openDel, setOpenDel] = useState(false); + + // loading + const [loadingEdit, setLoadingEdit] = useState(false); + const [loadingReport, setLoadingReport] = useState(false); + + // if (loadingEdit) return ; + + return ( + <> + + + { + close(); + setOpenDel(true); + }} + > + + + + + Hapus + + + + { + setLoadingEdit(true); + if (tipe === "posting") { + router.push(RouterForum.edit_posting + id); + } else { + router.push(RouterForum.edit_komentar + id); + } + }} + > + + + + + + Edit {tipe}{" "} + {loadingEdit ? : ""} + + + + + { + setLoadingReport(true); + if (tipe === "posting") { + router.push(RouterForum.report_posting + id); + } else { + router.push(RouterForum.report_komentar + id); + } + }} + > + + + + + + + Laporkan {tipe} + {" "} + {loadingReport ? : ""} + + + + + + + + + { + setOpenDel(false); + }} + centered + withCloseButton={false} + > + + Yakin menghapus {tipe} ini ? + + + + + + + + open()}> + + + + ); +} diff --git a/src/app_modules/forum/component/header/header_rata_kiri.tsx b/src/app_modules/forum/component/header/header_rata_kiri.tsx new file mode 100644 index 00000000..d99b6f8e --- /dev/null +++ b/src/app_modules/forum/component/header/header_rata_kiri.tsx @@ -0,0 +1,30 @@ +"use client"; + +import { ActionIcon, Group, Header, Title } from "@mantine/core"; +import { IconX } from "@tabler/icons-react"; +import { useRouter } from "next/navigation"; + +export default function ComponentForum_HeaderRataKiri({ + title, +}: { + title: string; +}) { + const router = useRouter(); + return ( + <> +
+ + { + router.back(); + }} + > + + + {title} + +
+ + ); +} diff --git a/src/app_modules/forum/component/header/header_tamplate.tsx b/src/app_modules/forum/component/header/header_tamplate.tsx new file mode 100644 index 00000000..4025fe08 --- /dev/null +++ b/src/app_modules/forum/component/header/header_tamplate.tsx @@ -0,0 +1,69 @@ +"use client"; + +import { Header, Group, ActionIcon, Text, Title } from "@mantine/core"; +import { IconArrowLeft, IconChevronLeft } from "@tabler/icons-react"; +import { useRouter } from "next/navigation"; +import { useState } from "react"; + +export default function ComponentForum_HeaderTamplate({ + hideBack, + changeIconBack, + route, + route2, + title, + icon, + bg, +}: { + hideBack?: boolean; + changeIconBack?: any; + route?: any; + route2?: any; + title: string; + icon?: any; + bg?: any; +}) { + const router = useRouter(); + return ( + <> +
+ + {hideBack ? ( + + ) : ( + { + if (route === null || route === undefined) { + return router.back(); + } else { + return router.push(route); + } + }} + > + {changeIconBack ? changeIconBack : } + + )} + {title} + {(() => { + if (route2 === null || route2 === undefined) { + return ; + } else { + return ( + router.push(route2)} + > + {icon} + + ); + } + })()} + +
+ + ); +} diff --git a/src/app_modules/forum/component/loading_drawer.tsx b/src/app_modules/forum/component/loading_drawer.tsx new file mode 100644 index 00000000..3a1a53ac --- /dev/null +++ b/src/app_modules/forum/component/loading_drawer.tsx @@ -0,0 +1,22 @@ +"use client"; + +import { Center, Group, LoadingOverlay, Skeleton } from "@mantine/core"; + +export default function ComponentForum_LoadingDrawer() { + const customLoad = ( +
+ + {Array(3) + .fill(0) + .map((e, i) => ( + + ))} + +
+ ); + return ( + <> + {customLoad} + + ); +} diff --git a/src/app_modules/forum/create/index.tsx b/src/app_modules/forum/create/index.tsx new file mode 100644 index 00000000..41e605d1 --- /dev/null +++ b/src/app_modules/forum/create/index.tsx @@ -0,0 +1,76 @@ +"use client"; + +import { + ActionIcon, + Button, + Center, + Group, + Loader, + Paper, + Stack, +} from "@mantine/core"; +import "react-quill/dist/quill.snow.css"; +import "react-quill/dist/quill.bubble.css"; +import { IconPhotoUp } from "@tabler/icons-react"; +import { useShallowEffect } from "@mantine/hooks"; +import { useRouter } from "next/navigation"; +import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2"; + +import dynamic from "next/dynamic"; +import React, { useState } from "react"; +const ReactQuill = dynamic( + () => { + return import("react-quill"); + }, + { ssr: false } +); + +export default function Forum_Create() { + const [value, setValue] = useState(""); + const [reload, setReload] = useState(false); + useShallowEffect(() => { + if (window && window.document) setReload(true); + }, []); + + if (!reload) + return ( + <> + + + ); + + return ( + <> + + + { + setValue(val); + }} + /> + + + {/* + + */} + + + +
+ + ); +} + +function ButtonAction() { + const router = useRouter(); + return ( + <> + + + ); +} diff --git a/src/app_modules/forum/create/layout.tsx b/src/app_modules/forum/create/layout.tsx new file mode 100644 index 00000000..2a82a5b0 --- /dev/null +++ b/src/app_modules/forum/create/layout.tsx @@ -0,0 +1,19 @@ +"use client"; + +import { AppShell } from "@mantine/core"; +import React from "react"; +import ComponentForum_HeaderTamplate from "../component/header/header_tamplate"; + +export default function LayoutForum_Create({ + children, +}: { + children: React.ReactNode; +}) { + return ( + <> + }> + {children} + + + ); +} diff --git a/src/app_modules/forum/detail/index.tsx b/src/app_modules/forum/detail/index.tsx new file mode 100644 index 00000000..3e5e3257 --- /dev/null +++ b/src/app_modules/forum/detail/index.tsx @@ -0,0 +1,133 @@ +"use client"; + +import { RouterForum } from "@/app/lib/router_hipmi/router_forum"; +import { + ActionIcon, + Box, + Card, + Divider, + Group, + Stack, + Text, +} from "@mantine/core"; +import { IconMessageCircle } from "@tabler/icons-react"; +import ComponentForum_AuthorNameOnHeader from "../component/author_header_name"; +import ComponentForum_AuthorNameOnDetail from "../component/author_name_on_detail"; +import { useRouter } from "next/navigation"; + +export default function Forum_Detail({ forumId }: { forumId: string }) { + return ( + <> + + + + + + ); +} + +function ForumView({ forumId }: { forumId: string }) { + const router = useRouter(); + return ( + <> + + + + + + + + Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad, + vitae. Quisquam aspernatur, eius consequatur dicta repellendus + facere vero recusandae deleniti voluptas quod architecto, tenetur + totam excepturi rem nam iusto earum. + + + + + + + + { + router.push(RouterForum.komentar + forumId); + }} + > + + + 1 + + + + {new Date( + "August 19, 1975 23:15:30 GMT+00:00" + ).toLocaleTimeString()} + + + {new Date().toLocaleDateString(["id-ID"], { + dateStyle: "medium", + })} + + + + + + + + + + + ); +} + +function DiskusiView() { + return ( + <> + + {Array(5) + .fill(0) + .map((e, i) => ( + + + + + + + + Lorem ipsum dolor sit amet, consectetur adipisicing elit. + Ad, vitae. Quisquam aspernatur, eius consequatur dicta + repellendus facere vero recusandae deleniti voluptas quod + architecto, tenetur totam excepturi rem nam iusto earum. + + + + + + {/* + + {new Date( + "August 19, 1975 23:15:30 GMT+00:00" + ).toLocaleTimeString()} + + + {new Date().toLocaleDateString(["id-ID"], { + dateStyle: "medium", + })} + + */} + + + + + + ))} + + + ); +} diff --git a/src/app_modules/forum/detail/layout.tsx b/src/app_modules/forum/detail/layout.tsx new file mode 100644 index 00000000..5acc9b8a --- /dev/null +++ b/src/app_modules/forum/detail/layout.tsx @@ -0,0 +1,38 @@ +"use client"; + +import { ActionIcon, AppShell, Group, Header, Title } from "@mantine/core"; +import React from "react"; +import ComponentForum_HeaderTamplate from "../component/header/header_tamplate"; +import { useRouter } from "next/navigation"; +import { IconChevronLeft } from "@tabler/icons-react"; + +export default function LayoutForum_Detail({ + children, +}: { + children: React.ReactNode; +}) { + const router = useRouter(); + return ( + <> + + + { + router.back(); + }} + > + + + Postingan + + + } + > + {children} + + + ); +} diff --git a/src/app_modules/forum/edit/komentar/index.tsx b/src/app_modules/forum/edit/komentar/index.tsx new file mode 100644 index 00000000..e97c6cdc --- /dev/null +++ b/src/app_modules/forum/edit/komentar/index.tsx @@ -0,0 +1,84 @@ +"use client" + +import { + ActionIcon, + Button, + Center, + Group, + Loader, + Paper, + Stack, +} from "@mantine/core"; +import "react-quill/dist/quill.snow.css"; +import "react-quill/dist/quill.bubble.css"; +import { IconPhotoUp } from "@tabler/icons-react"; +import { useShallowEffect } from "@mantine/hooks"; +import { useRouter } from "next/navigation"; +import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2"; + + +import dynamic from "next/dynamic"; +import React, { useState } from "react"; +import { useAtom } from "jotai"; +import { gs_forum_loading_edit_posting } from "../../global_state"; +const ReactQuill = dynamic( + () => { + return import("react-quill"); + }, + { ssr: false } +); + +export default function Forum_EditKomentar() { + const [value, setValue] = useState(""); + const [reload, setReload] = useState(false); + useShallowEffect(() => { + if (window && window.document) setReload(true); + }, []); + + if (!reload) + return ( + <> + + + ); + + return ( + <> + + + { + setValue(val); + }} + /> + + + {/* + + */} + + + +
+ + ); +} + +function ButtonAction() { + const router = useRouter(); + const [loadingEdit, setLoadingEdit] = useAtom(gs_forum_loading_edit_posting); + + return ( + <> + + + ); +} diff --git a/src/app_modules/forum/edit/komentar/layout.tsx b/src/app_modules/forum/edit/komentar/layout.tsx new file mode 100644 index 00000000..f153d9a1 --- /dev/null +++ b/src/app_modules/forum/edit/komentar/layout.tsx @@ -0,0 +1,21 @@ +"use client"; + +import { AppShell } from "@mantine/core"; +import React from "react"; +import ComponentForum_HeaderTamplate from "../../component/header/header_tamplate"; + +export default function LayoutForum_EditKomentar({ + children, +}: { + children: React.ReactNode; +}) { + return ( + <> + } + > + {children} + + + ); +} diff --git a/src/app_modules/forum/edit/posting/index.tsx b/src/app_modules/forum/edit/posting/index.tsx new file mode 100644 index 00000000..4898bb4d --- /dev/null +++ b/src/app_modules/forum/edit/posting/index.tsx @@ -0,0 +1,84 @@ +"use client" + +import { + ActionIcon, + Button, + Center, + Group, + Loader, + Paper, + Stack, +} from "@mantine/core"; +import "react-quill/dist/quill.snow.css"; +import "react-quill/dist/quill.bubble.css"; +import { IconPhotoUp } from "@tabler/icons-react"; +import { useShallowEffect } from "@mantine/hooks"; +import { useRouter } from "next/navigation"; +import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2"; + + +import dynamic from "next/dynamic"; +import React, { useState } from "react"; +import { useAtom } from "jotai"; +import { gs_forum_loading_edit_posting } from "../../global_state"; +const ReactQuill = dynamic( + () => { + return import("react-quill"); + }, + { ssr: false } +); + +export default function Forum_EditPosting() { + const [value, setValue] = useState(""); + const [reload, setReload] = useState(false); + useShallowEffect(() => { + if (window && window.document) setReload(true); + }, []); + + if (!reload) + return ( + <> + + + ); + + return ( + <> + + + { + setValue(val); + }} + /> + + + {/* + + */} + + + +
+ + ); +} + +function ButtonAction() { + const router = useRouter(); + const [loadingEdit, setLoadingEdit] = useAtom(gs_forum_loading_edit_posting); + + return ( + <> + + + ); +} diff --git a/src/app_modules/forum/edit/posting/layout.tsx b/src/app_modules/forum/edit/posting/layout.tsx new file mode 100644 index 00000000..94e0f885 --- /dev/null +++ b/src/app_modules/forum/edit/posting/layout.tsx @@ -0,0 +1,21 @@ +"use client"; + +import { AppShell } from "@mantine/core"; +import React from "react"; +import ComponentForum_HeaderTamplate from "../../component/header/header_tamplate"; + +export default function LayoutForum_EditPosting({ + children, +}: { + children: React.ReactNode; +}) { + return ( + <> + } + > + {children} + + + ); +} diff --git a/src/app_modules/forum/forumku/index.tsx b/src/app_modules/forum/forumku/index.tsx new file mode 100644 index 00000000..a2b5a566 --- /dev/null +++ b/src/app_modules/forum/forumku/index.tsx @@ -0,0 +1,136 @@ +"use client"; + +import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog"; +import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/component_global/author_name_on_header"; +import { MODEL_USER } from "@/app_modules/home/model/interface"; +import { + ActionIcon, + Avatar, + Button, + Card, + Center, + Divider, + Group, + Stack, + Text, +} from "@mantine/core"; +import { IconCircleFilled, IconMessageCircle } from "@tabler/icons-react"; +import { useRouter } from "next/navigation"; +import ComponentForum_AuthorNameOnHeader from "../component/author_header_name"; +import { RouterForum } from "@/app/lib/router_hipmi/router_forum"; +import { useState } from "react"; +import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2"; + +export default function Forum_Forumku({ + auhtorSelectedData, +}: { + auhtorSelectedData: MODEL_USER; +}) { + const router = useRouter(); + const [loadingDetail, setLoaduingDetail] = useState(false); + const [loadingKomen, setLoadingKomen] = useState(false); + + if (loadingDetail) return ; + if (loadingKomen) return ; + return ( + <> + +
+ +
+ + + + {auhtorSelectedData?.Profile?.name} + + + @{auhtorSelectedData?.username}{" "} + + 5 Posting + + + + + + + + + {Array(5) + .fill(0) + .map((e, i) => ( + + + + + { + // console.log("halaman forum"); + setLoaduingDetail(true); + router.push(RouterForum.main_detail + i); + }} + > + + + Lorem ipsum dolor sit amet, consectetur adipisicing elit. + Ad, vitae. Quisquam aspernatur, eius consequatur dicta + repellendus facere vero recusandae deleniti voluptas quod + architecto, tenetur totam excepturi rem nam iusto earum. + + + + + + + { + setLoadingKomen(true); + router.push(RouterForum.komentar + i); + }} + > + + + 1 + + + + + + ))} + +
+ + ); +} diff --git a/src/app_modules/forum/forumku/layout.tsx b/src/app_modules/forum/forumku/layout.tsx new file mode 100644 index 00000000..a6a1f824 --- /dev/null +++ b/src/app_modules/forum/forumku/layout.tsx @@ -0,0 +1,24 @@ +"use client"; + +import { AppShell } from "@mantine/core"; +import React from "react"; +import ComponentForum_HeaderTamplate from "../component/header/header_tamplate"; +import { MODEL_USER } from "@/app_modules/home/model/interface"; + +export default function LayoutForum_Forumku({ + children, + username, +}: { + children: React.ReactNode; + username: string; +}) { + return ( + <> + } + > + {children} + + + ); +} diff --git a/src/app_modules/forum/global_state/index.tsx b/src/app_modules/forum/global_state/index.tsx new file mode 100644 index 00000000..aa86ad42 --- /dev/null +++ b/src/app_modules/forum/global_state/index.tsx @@ -0,0 +1,3 @@ +import { atomWithStorage } from "jotai/utils"; + +export const gs_forum_loading_edit_posting = atomWithStorage("gs_forum_loading_edit_posting", false) \ No newline at end of file diff --git a/src/app_modules/forum/index.ts b/src/app_modules/forum/index.ts new file mode 100644 index 00000000..fb864b53 --- /dev/null +++ b/src/app_modules/forum/index.ts @@ -0,0 +1,41 @@ +import Forum_Splash from "./splash"; +import Forum_Beranda from "./main/beranda"; +import LayoutForum_Main from "./main/layout"; +import Forum_Forumku from "./forumku"; +import Forum_Create from "./create"; +import LayoutForum_Create from "./create/layout"; +import LayoutForum_Forumku from "./forumku/layout"; +import Forum_Detail from "./detail"; +import LayoutForum_Detail from "./detail/layout"; +import Forum_Komentar from "./komentar"; +import LayoutForum_Komentar from "./komentar/layout"; +import Forum_EditPosting from "./edit/posting"; +import LayoutForum_EditPosting from "./edit/posting/layout"; +import Forum_ReportPosting from "./report/posting"; +import LayoutForum_ReportPosting from "./report/posting/layout"; +import Forum_EditKomentar from "./edit/komentar"; +import LayoutForum_EditKomentar from "./edit/komentar/layout"; +import Forum_ReportKomentar from "./report/komentar"; +import LayoutForum_ReportKomentar from "./report/komentar/layout"; + +export { + Forum_Splash, + Forum_Beranda, + LayoutForum_Main, + Forum_Forumku, + Forum_Create, + LayoutForum_Create, + LayoutForum_Forumku, + Forum_Detail, + LayoutForum_Detail, + Forum_Komentar, + LayoutForum_Komentar, + Forum_EditPosting, + LayoutForum_EditPosting, + Forum_ReportPosting, + LayoutForum_ReportPosting, + Forum_EditKomentar, + LayoutForum_EditKomentar as LaoyoutForum_EditKomentar, + Forum_ReportKomentar, + LayoutForum_ReportKomentar, +}; diff --git a/src/app_modules/forum/komentar/index.tsx b/src/app_modules/forum/komentar/index.tsx new file mode 100644 index 00000000..1393c49a --- /dev/null +++ b/src/app_modules/forum/komentar/index.tsx @@ -0,0 +1,86 @@ +"use client"; + +import { RouterForum } from "@/app/lib/router_hipmi/router_forum"; +import { + ActionIcon, + Button, + Card, + Group, + Paper, + Stack, + Text, +} from "@mantine/core"; +import ComponentForum_AuthorNameOnHeader from "../component/author_header_name"; + +import dynamic from "next/dynamic"; +import React, { useState } from "react"; +const ReactQuill = dynamic( + () => { + return import("react-quill"); + }, + { ssr: false } +); +import "react-quill/dist/quill.bubble.css"; +import { IconPhotoUp } from "@tabler/icons-react"; +import { useRouter } from "next/navigation"; + +export default function Forum_Komentar({ forumId }: { forumId: string }) { + const [value, setValue] = useState(""); + + return ( + <> + + + + + + + + + Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad, + vitae. Quisquam aspernatur, eius consequatur dicta repellendus + facere vero recusandae deleniti voluptas quod architecto, + tenetur totam excepturi rem nam iusto earum. + + + + + + + { + setValue(val); + }} + /> + + + + + + + + + + + ); +} + +function ButtonAction({ forumId }: { forumId: string }) { + const router = useRouter(); + return ( + <> + + + ); +} diff --git a/src/app_modules/forum/komentar/layout.tsx b/src/app_modules/forum/komentar/layout.tsx new file mode 100644 index 00000000..082fcc62 --- /dev/null +++ b/src/app_modules/forum/komentar/layout.tsx @@ -0,0 +1,46 @@ +"use client"; + +import { + ActionIcon, + AppShell, + Button, + Group, + Header, + Title, +} from "@mantine/core"; +import { IconChevronLeft } from "@tabler/icons-react"; +import { useRouter } from "next/navigation"; +import React from "react"; +import ComponentForum_HeaderTamplate from "../component/header/header_tamplate"; + +export default function LayoutForum_Komentar({ + children, +}: { + children: React.ReactNode; +}) { + const router = useRouter(); + return ( + <> + + + { + router.back(); + }} + > + + + Komentar + + + } + // header={} + > + {children} + + + ); +} diff --git a/src/app_modules/forum/main/beranda.tsx b/src/app_modules/forum/main/beranda.tsx new file mode 100644 index 00000000..10db345f --- /dev/null +++ b/src/app_modules/forum/main/beranda.tsx @@ -0,0 +1,117 @@ +"use client"; + +import { RouterForum } from "@/app/lib/router_hipmi/router_forum"; +import { RouterJob } from "@/app/lib/router_hipmi/router_job"; +import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/component_global/author_name_on_header"; +import { + Affix, + rem, + ActionIcon, + Card, + CardSection, + Text, + Stack, + Divider, + Group, +} from "@mantine/core"; +import { useTimeout, useWindowScroll } from "@mantine/hooks"; +import { + IconCirclePlus, + IconMessageCircle, + IconPencilPlus, +} from "@tabler/icons-react"; +import { useRouter } from "next/navigation"; +import ComponentForum_AuthorNameOnHeader from "../component/author_header_name"; +import { useState } from "react"; +import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2"; +import { useAtom } from "jotai"; +import { gs_forum_loading_edit_posting } from "../global_state"; + +export default function Forum_Beranda() { + const router = useRouter(); + const skrng = Date.now(); + const [scroll, scrollTo] = useWindowScroll(); + const [loadingCreate, setLoadingCreate] = useState(false); + const [loadingKomen, setLoadingKomen] = useState(false); + const [loadingDetail, setLoaduingDetail] = useState(false); + + if (loadingDetail) return ; + if (loadingKomen) return ; + + return ( + <> + + 0 ? 0.5 : ""} + style={{ + transition: "0.5s", + }} + size={"xl"} + radius={"xl"} + variant="transparent" + bg={"blue"} + onClick={() => { + setLoadingCreate(true); + router.push(RouterForum.create); + }} + > + + + + + + {Array(5) + .fill(0) + .map((e, i) => ( + + + + + { + // console.log("halaman forum"); + setLoaduingDetail(true); + router.push(RouterForum.main_detail + i); + }} + > + + + Lorem ipsum dolor sit amet, consectetur adipisicing elit. + Ad, vitae. Quisquam aspernatur, eius consequatur dicta + repellendus facere vero recusandae deleniti voluptas quod + architecto, tenetur totam excepturi rem nam iusto earum. + + + + + + + { + setLoadingKomen(true); + router.push(RouterForum.komentar + i); + }} + > + + + 1 + + + + + + ))} + + + ); +} diff --git a/src/app_modules/forum/main/layout.tsx b/src/app_modules/forum/main/layout.tsx new file mode 100644 index 00000000..85ae4f3c --- /dev/null +++ b/src/app_modules/forum/main/layout.tsx @@ -0,0 +1,133 @@ +"use client"; + +import { + ActionIcon, + AppShell, + Avatar, + Center, + Footer, + Grid, + Group, + Header, + Stack, + Text, + Title, +} from "@mantine/core"; +import React, { useState } from "react"; +import ComponentForum_HeaderTamplate from "../component/header/header_tamplate"; +import { RouterHome } from "@/app/lib/router_hipmi/router_home"; +import { RouterForum } from "@/app/lib/router_hipmi/router_forum"; +import { IconChevronLeft, IconCircle, IconHome } from "@tabler/icons-react"; +import router from "next/router"; +import { useRouter } from "next/navigation"; +import { title } from "process"; +import { MODEL_USER } from "@/app_modules/home/model/interface"; +import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog"; + +export default function LayoutForum_Main({ + children, + dataAuthor, +}: { + children: React.ReactNode; + dataAuthor: MODEL_USER; +}) { + const router = useRouter(); + const [hotMenu, setHotMenu] = useState(1); + const [loading, setLoading] = useState(false); + + const listFooter = [ + { + id: 1, + name: "Beranda", + path: RouterForum.beranda, + icon: , + }, + + { + id: 2, + name: "ForumKu", + path: RouterForum.forumku, + icon: , + }, + ]; + + return ( + <> + + + { + return router.push(RouterHome.main_home); + }} + > + + + + Forum + { + setLoading(true); + router.push(RouterForum.forumku + dataAuthor?.id); + }} + > + + + + + } + + // footer={ + //
+ // + // {listFooter.map((e) => ( + // { + // router.replace(e.path); + // setHotMenu(e.id); + // }} + // > + //
+ // + // + // {e.icon} + // + // + // {e.name} + // + // + //
+ //
+ // ))} + //
+ //
+ // } + > + {children} +
+ + ); +} diff --git a/src/app_modules/forum/report/komentar/index.tsx b/src/app_modules/forum/report/komentar/index.tsx new file mode 100644 index 00000000..efdbd538 --- /dev/null +++ b/src/app_modules/forum/report/komentar/index.tsx @@ -0,0 +1,11 @@ +"use client" + +import { Stack } from "@mantine/core" + +export default function Forum_ReportKomentar({id}: {id: string}){ + return <> + + ini laporan + + +} \ No newline at end of file diff --git a/src/app_modules/forum/report/komentar/layout.tsx b/src/app_modules/forum/report/komentar/layout.tsx new file mode 100644 index 00000000..2a9c3d91 --- /dev/null +++ b/src/app_modules/forum/report/komentar/layout.tsx @@ -0,0 +1,26 @@ +"use client"; + +import { ActionIcon, AppShell, Group, Header, Title } from "@mantine/core"; +import React from "react"; +import ComponentForum_HeaderTamplate from "../../component/header/header_tamplate"; +import { IconChevronLeft, IconX } from "@tabler/icons-react"; +import router from "next/router"; +import ComponentForum_HeaderRataKiri from "../../component/header/header_rata_kiri"; + +export default function LayoutForum_ReportKomentar({ + children, +}: { + children: React.ReactNode; +}) { + return ( + <> + + } + > + {children} + + + ); +} diff --git a/src/app_modules/forum/report/posting/index.tsx b/src/app_modules/forum/report/posting/index.tsx new file mode 100644 index 00000000..28fea8f8 --- /dev/null +++ b/src/app_modules/forum/report/posting/index.tsx @@ -0,0 +1,11 @@ +"use client" + +import { Stack } from "@mantine/core" + +export default function Forum_ReportPosting({id}: {id: string}){ + return <> + + ini laporan + + +} \ No newline at end of file diff --git a/src/app_modules/forum/report/posting/layout.tsx b/src/app_modules/forum/report/posting/layout.tsx new file mode 100644 index 00000000..8cb917eb --- /dev/null +++ b/src/app_modules/forum/report/posting/layout.tsx @@ -0,0 +1,26 @@ +"use client"; + +import { ActionIcon, AppShell, Group, Header, Title } from "@mantine/core"; +import React from "react"; +import ComponentForum_HeaderTamplate from "../../component/header/header_tamplate"; +import { IconChevronLeft, IconX } from "@tabler/icons-react"; +import router from "next/router"; +import ComponentForum_HeaderRataKiri from "../../component/header/header_rata_kiri"; + +export default function LayoutForum_ReportPosting({ + children, +}: { + children: React.ReactNode; +}) { + return ( + <> + + } + > + {children} + + + ); +} diff --git a/src/app_modules/forum/splash/index.tsx b/src/app_modules/forum/splash/index.tsx new file mode 100644 index 00000000..2d9e1281 --- /dev/null +++ b/src/app_modules/forum/splash/index.tsx @@ -0,0 +1,27 @@ +"use client"; + +import { RouterForum } from "@/app/lib/router_hipmi/router_forum"; +import { Center, Image, Paper } from "@mantine/core"; +import { useShallowEffect } from "@mantine/hooks"; +import { useRouter } from "next/navigation"; + +export default function Forum_Splash() { +const router = useRouter() + useShallowEffect(() => { + setTimeout(() => { + // setHotMenu(1); + // setStatus("Publish"); + router.replace(RouterForum.beranda); + }, 2000); + }, []); + + return ( + <> +
+ + logo + +
+ + ); +} diff --git a/src/app_modules/home/fun/get/get_one_user_by_id.ts b/src/app_modules/home/fun/get/get_one_user_by_id.ts index 1ceddd3a..132fb4a0 100644 --- a/src/app_modules/home/fun/get/get_one_user_by_id.ts +++ b/src/app_modules/home/fun/get/get_one_user_by_id.ts @@ -2,13 +2,14 @@ import prisma from "@/app/lib/prisma"; -export async function User_getOneById(userId: string) { +export async function user_getOneById(userId: string) { const data = await prisma.user.findFirst({ where: { id: userId, }, select: { id: true, + username: true, Profile: true, }, }); diff --git a/src/app_modules/home/view.tsx b/src/app_modules/home/view.tsx index 4e558468..80b6d85b 100644 --- a/src/app_modules/home/view.tsx +++ b/src/app_modules/home/view.tsx @@ -38,7 +38,8 @@ import { ComponentGlobal_NotifikasiPeringatan } from "../component_global/notif_ import { RouterJob } from "@/app/lib/router_hipmi/router_job"; import { useState } from "react"; import { useDisclosure } from "@mantine/hooks"; -import ComponentGlobal_LoadingPage from "../component_global/loading_page"; +import { RouterForum } from "@/app/lib/router_hipmi/router_forum"; +import ComponentGlobal_V2_LoadingPage from "../component_global/loading_page_v2"; export default function HomeView({ dataUser }: { dataUser: MODEL_USER }) { const router = useRouter(); @@ -51,7 +52,7 @@ export default function HomeView({ dataUser }: { dataUser: MODEL_USER }) { id: 1, name: "Forums", icon: , - link: "", + link: RouterForum.splash, }, { @@ -101,16 +102,7 @@ export default function HomeView({ dataUser }: { dataUser: MODEL_USER }) { return ( <> - {visible ? ( - - } - /> - - ) : ( - "" - )} + {visible ? : ""} diff --git a/yarn.lock b/yarn.lock index a4903cf7..ec82a380 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3717,6 +3717,11 @@ react-fast-marquee@^1.6.4: resolved "https://registry.yarnpkg.com/react-fast-marquee/-/react-fast-marquee-1.6.4.tgz#ac0bed0faee63e4d97e9b8cd03f3bea9f242fab3" integrity sha512-LAgvhRmHdqaUQ8R5jCUwzEGFUIjnCCt3T3W8X7j7wF6DWe0SATlpP0JX1V0pp2qX3DYUezmn1Iz5AtRFdL2EWQ== +react-icons@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/react-icons/-/react-icons-5.0.1.tgz#1694e11bfa2a2888cab47dcc30154ce90485feee" + integrity sha512-WqLZJ4bLzlhmsvme6iFdgO8gfZP17rfjYEJ2m9RsZjZ+cc4k1hTzknEz63YS1MeT50kVzoa1Nz36f4BEx+Wigw== + react-international-phone@^4.2.6: version "4.2.6" resolved "https://registry.yarnpkg.com/react-international-phone/-/react-international-phone-4.2.6.tgz#a92518b66b44015f5e32c96b646e0355056ae809"