From 0dde0f7613ea56c61a584e3129c0acd895db0807 Mon Sep 17 00:00:00 2001 From: amd123 Date: Tue, 26 Mar 2024 09:54:47 +0700 Subject: [PATCH] fix: dinamic ppid welcome banner --- components/Portal PPID/PublicInformation.tsx | 13 ------------- components/Portal PPID/ppid-banner.tsx | 12 +++++++++++- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/components/Portal PPID/PublicInformation.tsx b/components/Portal PPID/PublicInformation.tsx index 166a883..33da35e 100644 --- a/components/Portal PPID/PublicInformation.tsx +++ b/components/Portal PPID/PublicInformation.tsx @@ -7,21 +7,8 @@ export default function PublicInformation() { const pathname = usePathname() const currentPath = pathname; - let targetPath; - if (currentPath.includes('/satuan-kerja')) { - // Jika path adalah '/portal-ppid', arahkan ke '/portal-ppid/informasi-publik' - targetPath = '/portal-ppid/informasi-publik/informasi-serta-merta'; - } { - // Jika path adalah '/portal-ppid/satuan-kerja/div-humas', arahkan ke '/portal-ppid/satuan-kerja/div-humas/informasi-publik' - targetPath = '/portal-ppid/satuan-kerja/div-humas/informasi-publik/informasi-serta-merta'; - } - return (
-
- {targetPath}
- {currentPath} -
logo
diff --git a/components/Portal PPID/ppid-banner.tsx b/components/Portal PPID/ppid-banner.tsx index cb8aa05..d69c288 100644 --- a/components/Portal PPID/ppid-banner.tsx +++ b/components/Portal PPID/ppid-banner.tsx @@ -1,12 +1,22 @@ 'use client' import { Input } from "@nextui-org/input"; import { SearchIcon } from "../icons"; +import { usePathname } from "next/navigation"; interface PPIDBannerProps { url: string; } export default function PPIDBanner({ url }: PPIDBannerProps) { + const pathname = usePathname() + let isPolri; + + if (pathname === "/portal-ppid") { + isPolri = true; + } else { + isPolri = false; + } + console.log(isPolri) return (
@@ -17,7 +27,7 @@ export default function PPIDBanner({ url }: PPIDBannerProps) { />

- SELAMAT DATANG DI PORTAL E-PPID {url} + {`SELAMAT DATANG DI PORTAL E-PPID ${isPolri ? 'POLRI' : url}`}

Layanan ini merupakan fasilitas daring yang disediakan bagi para pemohon informasi publik, sebagai bagian dari implementasi prinsip keterbukaan informasi publik di Pusat Informasi dan Dokumentasi (PPID) Utama.