From 459ba0526173bf247ac152a92cbfa83ff8202d70 Mon Sep 17 00:00:00 2001 From: Rama Priyanto Date: Mon, 3 Feb 2025 19:55:03 +0700 Subject: [PATCH] fix:landing --- components/icons.tsx | 106 +++++++++++++ components/landing/BodyLayout.tsx | 4 +- components/landing/CategorySatker.tsx | 27 +++- components/landing/MediaSocial.tsx | 185 +++++++++++++---------- components/landing/RegionalNews.tsx | 28 ++-- components/landing/SidebarNav.tsx | 12 +- components/layout/navbar/NavbarHumas.tsx | 10 +- components/main/detail/comment.tsx | 3 + components/table/article-table.tsx | 3 +- config/site.ts | 3 +- 10 files changed, 272 insertions(+), 109 deletions(-) diff --git a/components/icons.tsx b/components/icons.tsx index fa90a7e..aab1136 100644 --- a/components/icons.tsx +++ b/components/icons.tsx @@ -2374,3 +2374,109 @@ export const BurgerButtonIcon = ({ /> ); + +export const XLandingIcon = ({ + size, + height = 24, + width = 24, + fill = "currentColor", + ...props +}: IconSvgProps) => ( + + + +); +export const InstagramLandingIcon = ({ + size, + height = 24, + width = 24, + fill = "currentColor", + ...props +}: IconSvgProps) => ( + + + +); +export const FacebookLandingIcon = ({ + size, + height = 24, + width = 24, + fill = "currentColor", + ...props +}: IconSvgProps) => ( + + + +); +export const TiktokLandingIcon = ({ + size, + height = 24, + width = 24, + fill = "currentColor", + ...props +}: IconSvgProps) => ( + + + +); +export const YoutubeLandingIcon = ({ + size, + height = 24, + width = 24, + fill = "currentColor", + ...props +}: IconSvgProps) => ( + + + +); diff --git a/components/landing/BodyLayout.tsx b/components/landing/BodyLayout.tsx index 9d8c9ad..cfe663b 100644 --- a/components/landing/BodyLayout.tsx +++ b/components/landing/BodyLayout.tsx @@ -11,9 +11,9 @@ export default function BodyLayout() { <>
- {/* */} - {/* */} + + {/* */}
diff --git a/components/landing/CategorySatker.tsx b/components/landing/CategorySatker.tsx index 1b75caa..423e40f 100644 --- a/components/landing/CategorySatker.tsx +++ b/components/landing/CategorySatker.tsx @@ -298,6 +298,11 @@ export default function CategorySatker() { // }; // }, [list]); + const changeNameToSlug = (name: string) => { + const cleaned = name.trim().toLowerCase(); + return cleaned.replace(/\s+/g, "-"); + }; + return (
@@ -309,7 +314,10 @@ export default function CategorySatker() {
{list.map((item: any, index: any) => ( - +
@@ -355,7 +364,12 @@ export default function CategorySatker() { key={index.id} className="w-[140px] h-[115px] flex flex-col items-center justify-center rounded-lg shadow-sm" > - + + {" "} - diff --git a/components/landing/MediaSocial.tsx b/components/landing/MediaSocial.tsx index 4194a89..e064497 100644 --- a/components/landing/MediaSocial.tsx +++ b/components/landing/MediaSocial.tsx @@ -1,111 +1,140 @@ import Link from "next/link"; import { ChevronRightIcon, + FacebookLandingIcon, FbIcon, IgIcon, + InstagramLandingIcon, + TiktokLandingIcon, TtIcon, TwitterIcon, + XLandingIcon, + YoutubeLandingIcon, YtIcon, } from "../icons"; import TwitterWidget from "../ui/social-media/twitter"; import InstagramWidget from "../ui/social-media/instagram"; import FacebookWidget from "../ui/social-media/facebook"; import YoutubeWidget from "../ui/social-media/youtube"; +import { useState } from "react"; +import { Button } from "@nextui-org/button"; export default function MediaSocial() { // const [limitedData, setLimitedData] = useState([]); - - const dummyData = [ - { - id: 1, - logo: "/logohumas.png", - division: "Divisi Humas Polri", - type: "/temp/offical.svg", - username: "@DivHumas_Polri", - followIcon: "/temp/iconX.svg", - description: - "Pada pembukaan KTT ke-43 ASEAN, Presiden RI, H. Joko Widodo menegaskan bahwa kesatuan ASEAN sampai saat ini masih terjaga dan terpelihara dengan baik.", - imageUrl: "/headernews.png", - }, - { - id: 2, - logo: "/logohumas.png", - division: "Divisi Humas Polri", - username: "@DivHumas_Polri", - type: "/temp/offical.svg", - followIcon: "/temp/iconX.svg", - description: - "Pada pembukaan KTT ke-43 ASEAN, Presiden RI, H. Joko Widodo menegaskan bahwa kesatuan ASEAN sampai saat ini masih terjaga dan terpelihara dengan baik.", - imageUrl: "/headernews.png", - }, - { - id: 3, - logo: "/logohumas.png", - division: "Divisi Humas Polri", - type: "/temp/offical.svg", - username: "@DivHumas_Polri", - followIcon: "/temp/iconX.svg", - description: - "Pada pembukaan KTT ke-43 ASEAN, Presiden RI, H. Joko Widodo menegaskan bahwa kesatuan ASEAN sampai saat ini masih terjaga dan terpelihara dengan baik.", - imageUrl: "/headernews.png", - }, - ]; + const [selectedPlatform, setSelectedPlatform] = useState("x"); return (

MediaSocial

-
-
+ +
+
-
- -
+ + + + +
-
-
-
- -

Instagram

-
-
-
- -
+
+
-
-
-
- -

Facebook

-
-
+
+ +
+
-
-
-
- -

Tiktok

-
-
+
-
-
-
- -

Youtube

-
-
-
- -
+
+
); diff --git a/components/landing/RegionalNews.tsx b/components/landing/RegionalNews.tsx index 1080117..9584da0 100644 --- a/components/landing/RegionalNews.tsx +++ b/components/landing/RegionalNews.tsx @@ -299,10 +299,8 @@ export default function RegionalNews() { // }, [list]); const changeNameToSlug = (name: string) => { - const cleaned = name.replace("Polda ", "").trim(); - const slug = cleaned.includes(" ") - ? cleaned.toLowerCase().replace(/\s+/g, "-") - : cleaned; + const cleaned = name.replace("Polda ", "").trim().toLowerCase(); + const slug = cleaned.replace(/\s+/g, "-"); return slug; }; @@ -321,7 +319,7 @@ export default function RegionalNews() {
{listPolda.map((item: any, index: any) => (
{(onClose) => ( <> - -
+ +

{" "} {t("beritaWilayah")} @@ -379,9 +377,7 @@ export default function RegionalNews() { className="w-[140px] h-[115px] flex flex-col items-center justify-center rounded-lg shadow-sm" >

-

+

{item.title}

@@ -398,7 +394,11 @@ export default function RegionalNews() { ))} - diff --git a/components/landing/SidebarNav.tsx b/components/landing/SidebarNav.tsx index 1d1037b..6db9e5e 100644 --- a/components/landing/SidebarNav.tsx +++ b/components/landing/SidebarNav.tsx @@ -91,10 +91,10 @@ export default function SidebarNav() { >
)} -

+ {/*

Pelayanan Informasi Publik

- + */} {/*
SERTIFIKAT ISO 9001:2015
@@ -163,7 +163,7 @@ export default function SidebarNav() {
*/} - {/*
+
Channel Humas Polri
-
*/} +
-

+ {/*

{" "} Info Eksternal

@@ -321,7 +321,7 @@ export default function SidebarNav() { Info dan Berita terbaru dari Komnas Perempuan Indonesia

-
+
*/} ); } diff --git a/components/layout/navbar/NavbarHumas.tsx b/components/layout/navbar/NavbarHumas.tsx index 4369e8c..d4bf46d 100644 --- a/components/layout/navbar/NavbarHumas.tsx +++ b/components/layout/navbar/NavbarHumas.tsx @@ -154,7 +154,6 @@ export default function NavbarHumas(props: { size: string }) { logo - - + {" "} + + E-PPID + setIsOpen(state)} diff --git a/components/main/detail/comment.tsx b/components/main/detail/comment.tsx index 46b39b8..0bf3e30 100644 --- a/components/main/detail/comment.tsx +++ b/components/main/detail/comment.tsx @@ -60,6 +60,7 @@ export default function Comment(props: { id: string | null }) { handleSubmit, formState: { errors }, setValue, + reset, } = useForm(formOptions); useEffect(() => { @@ -97,7 +98,9 @@ export default function Comment(props: { id: string | null }) { error(res?.message); return false; } + reset(); fetchData(); + setNeedOtp(false); } }; diff --git a/components/table/article-table.tsx b/components/table/article-table.tsx index 90c5b14..4082dc9 100644 --- a/components/table/article-table.tsx +++ b/components/table/article-table.tsx @@ -71,7 +71,7 @@ export default function ArticleTable() { useEffect(() => { initState(); - }, [page, showData, startDateValue]); + }, [page, showData, startDateValue, selectedCategories]); useEffect(() => { getCategories(); @@ -80,7 +80,6 @@ export default function ArticleTable() { async function getCategories() { const res = await getArticleByCategory(); const data = res?.data?.data; - console.log("datass", res?.data?.data); setCategoies(data); } diff --git a/config/site.ts b/config/site.ts index 564b70f..bf6523c 100644 --- a/config/site.ts +++ b/config/site.ts @@ -105,6 +105,8 @@ export const siteConfig = { }, ], }, + { key: "e-ppid", label: "E-PPID", href: "https://eppid.polri.go.id/" }, + { key: "public-information", label: "informasi_publik", @@ -195,7 +197,6 @@ export const siteConfig = { }, ], }, - { key: "related-app", label: "aplikasi_terkait",