From fc539c66f7b6138386621a52cc8b2379890357c3 Mon Sep 17 00:00:00 2001 From: Rama Priyanto Date: Wed, 26 Feb 2025 15:34:45 +0700 Subject: [PATCH] fixing landing --- app/layout.tsx | 2 +- app/page.tsx | 14 +- .../master-user-level-form.tsx | 14 +- components/icons.tsx | 37 +- components/landing/HeaderNews.tsx | 17 +- components/landing/MedolUpdate.tsx | 483 ++++++++++-------- components/landing/drawer.tsx | 108 ++++ components/layout/humas-layout.tsx | 4 +- components/layout/navbar/NavbarHumas.tsx | 401 +++++++++++---- components/main/detail/comment.tsx | 2 +- components/main/detail/new-detail.tsx | 8 +- components/page/detail-news.tsx | 29 +- components/page/related-news.tsx | 9 +- components/page/sidebar-detail.tsx | 49 +- 14 files changed, 783 insertions(+), 394 deletions(-) create mode 100644 components/landing/drawer.tsx diff --git a/app/layout.tsx b/app/layout.tsx index afa9996..ea6067e 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -70,7 +70,7 @@ export default function RootLayout({ children }: { children: ReactNode }) { className={clsx("bg-background font-sans antialiased", inter.className)} > - +
{children}
diff --git a/app/page.tsx b/app/page.tsx index fe71c97..609fe6b 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -2,9 +2,12 @@ import BannerHumasNew from "@/components/landing/banner-new"; import BannerHumas from "@/components/landing/BannerHumas"; import BodyLayout from "@/components/landing/BodyLayout"; +import AnalyticDrawer from "@/components/landing/drawer"; +import FooterNew from "@/components/landing/footer-new"; import HeaderNews from "@/components/landing/HeaderNews"; +import NewsTicker from "@/components/landing/NewsTicker"; import { HumasLayout } from "@/components/layout/humas-layout"; -import { useEffect, useState } from "react"; +import { Suspense, useEffect, useState } from "react"; export default function Home() { const [hasMounted, setHasMounted] = useState(false); @@ -18,11 +21,16 @@ export default function Home() { return ( <> - +
+ + - + + + +
); } diff --git a/components/form/master/master-user-level/master-user-level-form.tsx b/components/form/master/master-user-level/master-user-level-form.tsx index ed2bd9a..d0594f7 100644 --- a/components/form/master/master-user-level/master-user-level-form.tsx +++ b/components/form/master/master-user-level/master-user-level-form.tsx @@ -289,13 +289,6 @@ export default function CreateMasterUserLevelForm() { {errors?.name && (

{errors.name?.message}

)} - -

Need Approval

- -

- {needApproval ? "Active" : "Inactive"} -

-
{findSelectedLevel(selectedGroup)?.level === 3 && ( <>

Parent

@@ -319,6 +312,13 @@ export default function CreateMasterUserLevelForm() { )} +

Need Approval

+ +

+ {needApproval ? "Active" : "Inactive"} +

+
+
- -
+ {mediahubUpdate?.map((newsItem: any) => ( + + + + + tes + + +

+ {formatDate(newsItem?.createdAt)} +

+ + {textEllipsis(newsItem?.title, 50)} + +
+
+ +
+ ))} + +
+ + + +
+ + ) : ( +
+ +
+ )} - { - swiper.navigation.nextEl?.classList.add( - "bg-white/70", - "!text-black", - "rounded-full", - "!w-[40px]", - "!h-[40px]" - ); - swiper.navigation.prevEl?.classList.add( - "bg-white/70", - "!text-black", - "rounded-full", - "!w-[40px]", - "!h-[40px]" - ); - }} - > - {tbnUpdate?.map((newsItem: any) => ( - - - - - tes - - - {/* {convertDateFormatNoTime(newsItem?.date)} */} -

{formatDate(newsItem?.date)}

- - {textEllipsis(newsItem?.title, 50)} - -
-
- -
- ))} -
-
- - - -
+ {tbnUpdate?.map((newsItem: any) => ( + + + + + tes + + + {/* {convertDateFormatNoTime(newsItem?.date)} */} +

+ {formatDate(newsItem?.date)} +

+ + {textEllipsis(newsItem?.title, 50)} + +
+
+ +
+ ))} + +
+ + + +
+ + ) : ( +
+ +
+ )}
- { - swiper.navigation.nextEl?.classList.add( - "bg-white/70", - "!text-black", - "rounded-full", - "!w-[40px]", - "!h-[40px]" - ); - swiper.navigation.prevEl?.classList.add( - "bg-white/70", - "!text-black", - "rounded-full", - "!w-[40px]", - "!h-[40px]" - ); - }} - > - {inpUpdate?.map((newsItem: any) => ( - - - - - tes - - - {/* {newsItem?.created_at} */} -

{newsItem?.created_at}

- - {textEllipsis(newsItem?.judul, 50)} - -
-
- -
- ))} -
-
- - - -
+ {inpUpdate?.map((newsItem: any) => ( + + + + + tes + + + {/* {newsItem?.created_at} */} +

{newsItem?.created_at}

+ + {textEllipsis(newsItem?.judul, 50)} + +
+
+ +
+ ))} + +
+ + + +
+ + ) : ( +
+ +
+ )}
diff --git a/components/landing/drawer.tsx b/components/landing/drawer.tsx new file mode 100644 index 0000000..49bc072 --- /dev/null +++ b/components/landing/drawer.tsx @@ -0,0 +1,108 @@ +import { Button } from "@heroui/button"; +import { + Drawer, + DrawerContent, + DrawerHeader, + DrawerBody, + DrawerFooter, +} from "@heroui/drawer"; +import { useDisclosure } from "@heroui/react"; +import { ChevronDownIcon, LandingAnalyticIcon, UserIcon } from "../icons"; +import { MasterUsersIcon } from "../icons/sidebar-icon"; +import Image from "next/image"; +export default function AnalyticDrawer() { + const { isOpen, onOpen, onOpenChange } = useDisclosure(); + + return ( + <> +
+ +
+ + + {(onClose) => ( + <> + +

Statistik Kunjungan

+

+ Perhitungan jumlah kunjugan website +

+
+ +
+
+
+
+ +
+

Total visitor

+
+ logo +
+

+ 199.295 +

+
+
+

9 Online

+
+
+
+
+
+
+ +
+

Total View

+
+ logo +
+

+ 1.199.295 +

+
+
+ + )} +
+
+ + ); +} diff --git a/components/layout/humas-layout.tsx b/components/layout/humas-layout.tsx index 41baae7..cd425cd 100644 --- a/components/layout/humas-layout.tsx +++ b/components/layout/humas-layout.tsx @@ -21,8 +21,8 @@ export const HumasLayout = ({ children }: Props) => { if (!hasMounted) return null; return (
- {/* */} - {/* */} + + {children} diff --git a/components/layout/navbar/NavbarHumas.tsx b/components/layout/navbar/NavbarHumas.tsx index 252761d..7b11add 100644 --- a/components/layout/navbar/NavbarHumas.tsx +++ b/components/layout/navbar/NavbarHumas.tsx @@ -91,6 +91,7 @@ export default function NavbarHumas(props: { size: string }) { const searchInput = ( + } type="search" /> @@ -152,7 +153,13 @@ export default function NavbarHumas(props: { size: string }) { }`} > - logo + logo
- + logo

SP2HP

@@ -206,7 +219,13 @@ export default function NavbarHumas(props: { size: string }) {

- + logo

Formulir Permohonan Informasi @@ -227,7 +246,13 @@ export default function NavbarHumas(props: { size: string }) { } >

- + logo

Pelayanan SIM

@@ -242,7 +267,13 @@ export default function NavbarHumas(props: { size: string }) { onPress={() => window.open("https://erikkes.id/", "_blank")} >

- + logo

Pelayanan e-Rikkes SIM @@ -259,7 +290,13 @@ export default function NavbarHumas(props: { size: string }) { onPress={() => window.open("https://eppsi.id/", "_blank")} >

- + logo

Pelayanan Test Psikologi SIM @@ -280,7 +317,13 @@ export default function NavbarHumas(props: { size: string }) { } >

- + logo

Pelayanan e-Avis

@@ -296,7 +339,13 @@ export default function NavbarHumas(props: { size: string }) { } >

- + logo

Pelayanan Samsat Digital @@ -314,7 +363,13 @@ export default function NavbarHumas(props: { size: string }) { } >

- + logo

Pelayanan SKCK

@@ -333,7 +388,13 @@ export default function NavbarHumas(props: { size: string }) { } >

- + logo

Pelayanan Propam Presisi @@ -352,7 +413,13 @@ export default function NavbarHumas(props: { size: string }) { } >

- + logo

Pelayanan Dumas Presisi{" "} @@ -371,7 +438,13 @@ export default function NavbarHumas(props: { size: string }) { } >

- + logo

Pelayanan Binmas

@@ -391,7 +464,13 @@ export default function NavbarHumas(props: { size: string }) { } >

- + logo

Clean & Clear Polri{" "} @@ -696,7 +775,13 @@ export default function NavbarHumas(props: { size: string }) { } >

- + logo

Polri Super App

@@ -716,7 +801,13 @@ export default function NavbarHumas(props: { size: string }) { } >

- + logo

Media Hub

@@ -735,7 +826,13 @@ export default function NavbarHumas(props: { size: string }) { } >

- + logo

Polisiku

@@ -755,7 +852,13 @@ export default function NavbarHumas(props: { size: string }) { } >

- + logo

SP2HP

@@ -774,7 +877,13 @@ export default function NavbarHumas(props: { size: string }) { } >

- + logo

Polri TV

@@ -793,7 +902,13 @@ export default function NavbarHumas(props: { size: string }) { } >

- + logo

Polri Radio

@@ -812,7 +927,13 @@ export default function NavbarHumas(props: { size: string }) { } >

- + logo

e-Avis

@@ -826,7 +947,13 @@ export default function NavbarHumas(props: { size: string }) { onPress={() => window.open("https://erikkes.id/", "_blank")} >

- + logo

e-Rikkes

@@ -842,7 +969,13 @@ export default function NavbarHumas(props: { size: string }) { onPress={() => window.open("https://eppsi.id/", "_blank")} >

- + logo

e-PPSI

@@ -858,7 +991,13 @@ export default function NavbarHumas(props: { size: string }) { } >

- + logo

BOS

@@ -878,7 +1017,13 @@ export default function NavbarHumas(props: { size: string }) { } >

- + logo

Signal

@@ -894,7 +1039,13 @@ export default function NavbarHumas(props: { size: string }) { } >

- + logo

SKCK Online

@@ -913,7 +1064,13 @@ export default function NavbarHumas(props: { size: string }) { } >

- + logo

Propam Presisi

@@ -933,7 +1090,13 @@ export default function NavbarHumas(props: { size: string }) { } >

- + logo

Monitoring Presisi @@ -952,7 +1115,13 @@ export default function NavbarHumas(props: { size: string }) { } >

- + logo

SDM - Penerimaan POLRI @@ -973,7 +1142,13 @@ export default function NavbarHumas(props: { size: string }) { } >

- + logo

Whistle Blowing System{" "} @@ -994,7 +1169,13 @@ export default function NavbarHumas(props: { size: string }) { } >

- + logo

Dumas Presisi

@@ -1014,7 +1195,13 @@ export default function NavbarHumas(props: { size: string }) { } >

- + logo

Clean and Clear POLRI{" "} @@ -1035,7 +1222,13 @@ export default function NavbarHumas(props: { size: string }) { } >

- + logo

Sinar

@@ -1047,80 +1240,67 @@ export default function NavbarHumas(props: { size: string }) { -

-
- -
- -
- - - - - - - - - - - - - - {token ? ( - // - - - - - - router.push("/admin/dashboard")} - > - Dashboard - - Profile - - - Logout - - - - ) : ( - - +
@@ -1142,7 +1322,13 @@ export default function NavbarHumas(props: { size: string }) { >
- logo + logo
{subItem.img && ( - {subItem.img} diff --git a/components/main/detail/comment.tsx b/components/main/detail/comment.tsx index 7f37e41..5bb3558 100644 --- a/components/main/detail/comment.tsx +++ b/components/main/detail/comment.tsx @@ -283,7 +283,7 @@ export default function Comment(props: { id: string | null }) { return (
{!needOtp ? ( diff --git a/components/main/detail/new-detail.tsx b/components/main/detail/new-detail.tsx index 8f57a04..e157f9d 100644 --- a/components/main/detail/new-detail.tsx +++ b/components/main/detail/new-detail.tsx @@ -55,16 +55,16 @@ export default function NewsDetailPage() { const resActivity = await saveActivity(req, token); }; return ( -
+
-
+
Beranda

Berita

-
+
@@ -75,7 +75,7 @@ export default function NewsDetailPage() {
-
+
diff --git a/components/page/detail-news.tsx b/components/page/detail-news.tsx index f76c17b..94ae6ab 100644 --- a/components/page/detail-news.tsx +++ b/components/page/detail-news.tsx @@ -189,7 +189,32 @@ export default function DetailNews(props: { data: any; listArticle: any }) { className="text-sm lg:text-xl lg:leading-8 text-justify space-y-4" /> -
+
+

TAGS

+
+ {data?.categories?.map((category: any) => ( + + + + ))} +
+
+ {data?.tags?.split(",").map((tag: any) => ( + + + + ))} +
+
+
-
+
{prevArticle === "" ? (

Sebelumnya diff --git a/components/page/related-news.tsx b/components/page/related-news.tsx index e17c132..92f929e 100644 --- a/components/page/related-news.tsx +++ b/components/page/related-news.tsx @@ -27,9 +27,8 @@ export default function RelatedNews() { return (

-
Berita Terkait
-
- +
+ Berita Terkait
@@ -67,7 +66,9 @@ export default function RelatedNews() { {article?.map((newsItem: any) => ( - headernews([]); @@ -25,18 +26,14 @@ export default function SidebarDetail() { }, []); return (
-
+
-
- Humas MABES POLRI -
-
- +
+ Humas MABES POLRI
-
+
{article?.map((newsItem: any) => ( -
- + headernews

- {textEllipsis(newsItem.title, 30)} + {textEllipsis(newsItem.title, 45)}

@@ -81,16 +80,12 @@ export default function SidebarDetail() {

-
- Humas POLDA -
-
- +
+ Humas POLDA
-
+
{article?.map((newsItem: any) => ( -
- + headernews
-

- {textEllipsis(newsItem.title, 40)} +

+ {textEllipsis(newsItem.title, 45)}