fix: fixing logo satker and polda in navbar

This commit is contained in:
Sabda Yagra 2025-06-05 13:49:13 +07:00
parent ea6eacadbe
commit 17a37e00d0
28 changed files with 121 additions and 24 deletions

View File

@ -13,7 +13,7 @@ const regions = [
{ {
name: "Polda Bangka Belitung", name: "Polda Bangka Belitung",
slug: "bangka-belitung", slug: "bangka-belitung",
logo: "/logo/polda/polda-bangkabelitung.png", logo: "/logo/polda/polda-bangka-belitung.png",
}, },
{ {
name: "Polda Banten", name: "Polda Banten",
@ -27,7 +27,7 @@ const regions = [
}, },
{ {
name: "Polda DIY", name: "Polda DIY",
slug: "di-yogyakarta", slug: "jogja",
logo: "/logo/polda/polda-jogja.png", logo: "/logo/polda/polda-jogja.png",
}, },
{ {
@ -39,17 +39,17 @@ const regions = [
{ {
name: "Polda Jawa Barat", name: "Polda Jawa Barat",
slug: "jawa-barat", slug: "jawa-barat",
logo: "/logo/polda/polda-jawabarat.png", logo: "/logo/polda/polda-jawa-barat.png",
}, },
{ {
name: "Polda Jawa Tengah", name: "Polda Jawa Tengah",
slug: "jawa-tengah", slug: "jawa-tengah",
logo: "/logo/polda/polda-jawatengah.png", logo: "/logo/polda/polda-jawa-tengah.png",
}, },
{ {
name: "Polda Jawa Timur", name: "Polda Jawa Timur",
slug: "jawa-timur", slug: "jawa-timur",
logo: "/logo/polda/polda-jawatimur.png", logo: "/logo/polda/polda-jawa-timur.png",
}, },
{ {
name: "Polda Kalimantan Barat", name: "Polda Kalimantan Barat",
@ -79,7 +79,7 @@ const regions = [
{ {
name: "Polda Kepulauan Riau", name: "Polda Kepulauan Riau",
slug: "kepulauan-riau", slug: "kepulauan-riau",
logo: "/logo/polda/polda-kepri.png", logo: "/logo/polda/polda-kepulauan-riau.png",
}, },
{ {
name: "Polda Lampung", name: "Polda Lampung",
@ -99,7 +99,7 @@ const regions = [
{ {
name: "Polda Metro Jaya", name: "Polda Metro Jaya",
slug: "metro-jaya", slug: "metro-jaya",
logo: "/logo/polda/polda-metro.png", logo: "/logo/polda/polda-metro-jaya.png",
}, },
{ {
name: "Polda NTB", name: "Polda NTB",
@ -121,12 +121,12 @@ const regions = [
{ {
name: "Polda Sulawesi Barat", name: "Polda Sulawesi Barat",
slug: "sulawesi-barat", slug: "sulawesi-barat",
logo: "/logo/polda/polda-sulbar.png", logo: "/logo/polda/polda-sulawesi-barat.png",
}, },
{ {
name: "Polda Sulawesi Selatan", name: "Polda Sulawesi Selatan",
slug: "sulawesi-selatan", slug: "sulawesi-selatan",
logo: "/logo/polda/polda-sulsel.png", logo: "/logo/polda/polda-sulawesi-selatan.png",
}, },
{ {
name: "Polda Sulawesi Tengah", name: "Polda Sulawesi Tengah",
@ -151,12 +151,12 @@ const regions = [
{ {
name: "Polda Sumatera Selatan", name: "Polda Sumatera Selatan",
slug: "sumatera-selatan", slug: "sumatera-selatan",
logo: "/logo/polda/polda-sumsel.png", logo: "/logo/polda/polda-sumatera-selatan.png",
}, },
{ {
name: "Polda Sumatera Utara", name: "Polda Sumatera Utara",
slug: "sumatera-utara", slug: "sumatera-utara",
logo: "/logo/polda/polda-sumut.png", logo: "/logo/polda/polda-sumatera-utara.png",
}, },
// { // {
// name: "Satuan Kerja POLRI", // name: "Satuan Kerja POLRI",

View File

@ -18,13 +18,13 @@ const regions = [
{ name: "STAMARENA POLRI", slug: "srena", logo: "/logo/satker/SRENA.png" }, { name: "STAMARENA POLRI", slug: "srena", logo: "/logo/satker/SRENA.png" },
{ name: "SSDM POLRI", slug: "ssdm", logo: "/logo/satker/SSDM.png" }, { name: "SSDM POLRI", slug: "ssdm", logo: "/logo/satker/SSDM.png" },
{ name: "SLOG POLRI", slug: "slog", logo: "/logo/satker/SLOG.png" }, { name: "SLOG POLRI", slug: "slog", logo: "/logo/satker/SLOG.png" },
{ name: "SAHLI KAPOLRI", slug: "sahli-kapolri", logo: "/logo/satker/STAFAHLI.png" }, { name: "SAHLI KAPOLRI", slug: "stafahli", logo: "/logo/satker/STAFAHLI.png" },
{ name: "DIVPROPRAM POLRI", slug: "divpropram", logo: "/logo/satker/DIVPROPAM.png" }, { name: "DIVPROPRAM POLRI", slug: "divpropram", logo: "/logo/satker/DIVPROPAM.png" },
{ name: "DIVKUM", slug: "divkum", logo: "/assets/satker/divkum.png" }, { name: "DIVKUM", slug: "divkum", logo: "/assets/satker/divkum.png" },
{ name: "DIVHUBINTER POLRI", slug: "divhubinter", logo: "/logo/satker/DIVHUBINTER.png" }, { name: "DIVHUBINTER POLRI", slug: "divhubinter", logo: "/logo/satker/DIVHUBINTER.png" },
{ name: "DIVTIK POLRI", slug: "div-tik", logo: "/logo/satker/DIV-TIK.png" }, { name: "DIVTIK POLRI", slug: "div-tik", logo: "/logo/satker/DIV-TIK.png" },
{ name: "KORLANTAS POLRI", slug: "korlantas", logo: "/logo/satker/KORLANTAS.png" }, { name: "KORLANTAS POLRI", slug: "korlantas", logo: "/logo/satker/KORLANTAS.png" },
{ name: "DENSUS 88 POLRI", slug: "densus-88", logo: "/logo/satker/DENSUS88.png" }, { name: "DENSUS 88 POLRI", slug: "densus-88", logo: "/logo/satker/DENSUS-88.png" },
{ name: "PUSDOKKES POLRI", slug: "pusdokkes", logo: "/logo/satker/PUSDOKKES.png" }, { name: "PUSDOKKES POLRI", slug: "pusdokkes", logo: "/logo/satker/PUSDOKKES.png" },
{ name: "PUSLITBANG POLRI", slug: "puslitbang", logo: "/logo/satker/PUSLITBANG.png" }, { name: "PUSLITBANG POLRI", slug: "puslitbang", logo: "/logo/satker/PUSLITBANG.png" },
{ name: "PUSKEU POLRI", slug: "puskeu", logo: "/logo/satker/PUSKEU.png" }, { name: "PUSKEU POLRI", slug: "puskeu", logo: "/logo/satker/PUSKEU.png" },
@ -47,10 +47,10 @@ const regions = [
{ name: "STIK LEMDIKLAT POLRI", slug: "stik-ptik", logo: "/logo/satker/STIK-PTIK.png" }, { name: "STIK LEMDIKLAT POLRI", slug: "stik-ptik", logo: "/logo/satker/STIK-PTIK.png" },
{ name: "AKPOL LEMDIKLAT POLRI", slug: "akpol", logo: "/logo/satker/AKPOL.png" }, { name: "AKPOL LEMDIKLAT POLRI", slug: "akpol", logo: "/logo/satker/AKPOL.png" },
{ name: "SESPIM LEMDIKLAT POLRI", slug: "sespim-polri", logo: "/logo/satker/SESPIM-POLRI.png" }, { name: "SESPIM LEMDIKLAT POLRI", slug: "sespim-polri", logo: "/logo/satker/SESPIM-POLRI.png" },
{ name: "SETUKPA LEMDIKLAT POLRI", slug: "setupa-polri", logo: "/assets/satker/setupa-polri.png" }, { name: "SETUKPA LEMDIKLAT POLRI", slug: "setupa-polri", logo: "/logo/satker/SETUPA-POLRI.png" },
{ name: "SEPOLWAN LEMDIKLAT POLRI", slug: "sepolwan-polri", logo: "/assets/satker/sepolwan.png" }, { name: "SEPOLWAN LEMDIKLAT POLRI", slug: "sepolwan-polri", logo: "/logo/satker/SEPOLWAN-POLRI.png" },
{ name: "SEBASA LEMDIKLAT POLRI", slug: "sebasa-polri", logo: "/assets/satker/sebasa.png" }, { name: "SEBASA LEMDIKLAT POLRI", slug: "sebasa-polri", logo: "/logo/satker/SEBASA-POLRI.png" },
{ name: "RUMKIT BHAYANGKARA TK I", slug: "rumkit-bhayangkara", logo: "/assets/satker/rumkit.png" }, { name: "RUMKIT BHAYANGKARA TK I", slug: "rumkit-bhayangkara", logo: "/logo/satker/RUMKIT-BHAYANGKARA.png" },
{ name: "POLAIR", slug: "polair", logo: "/logo/satker/POLAIR.png" }, { name: "POLAIR", slug: "polair", logo: "/logo/satker/POLAIR.png" },
{ name: "POLUDARA", slug: "poludara", logo: "/logo/satker/POLUDARA.png" }, { name: "POLUDARA", slug: "poludara", logo: "/logo/satker/POLUDARA.png" },
{ name: "PUSINAFIS", slug: "pusinafis", logo: "/logo/satker/PUSINAFIS.png" }, { name: "PUSINAFIS", slug: "pusinafis", logo: "/logo/satker/PUSINAFIS.png" },

View File

@ -0,0 +1,12 @@
"use client";
import Image from "next/image";
import { usePathname } from "next/navigation";
export const DynamicLogoSatker = () => {
const pathname = usePathname();
const satker = pathname?.split("/")[3];
console.log("polda", satker)
return <div className="p-2">{pathname?.includes("/satker") && <Image src={`/logo/satker/${satker}.png`} alt="Logo" width={1920} height={1080} className="object-contain h-[150px] w-[50px]" />}</div>;
};

View File

@ -0,0 +1,83 @@
import { listDataAdvertisements } from "@/service/broadcast/broadcast";
import { useEffect, useState } from "react";
import * as React from "react";
interface Advertisement {
id: string;
imageUrl: string;
[key: string]: any; // Tambahan kalau ada properti lain
}
// // Simulasi fungsi API (replace dengan yang asli)
// async function listDataAdvertisements(
// page: number,
// size: number,
// search: string,
// category: string,
// status: string
// ) {
// // contoh struktur response dummy
// return {
// data: {
// data: {
// content: [
// { id: "1", imageUrl: "/images/all-img/kiri1.png" },
// { id: "2", imageUrl: "/images/all-img/kiri2.png" },
// ],
// totalElements: 2,
// totalPages: 1,
// },
// },
// };
// }
const LeftBanner = () => {
const [ads, setAds] = useState<Advertisement[]>([]);
const [loading, setLoading] = useState<boolean>(false);
const [showData, setShowData] = React.useState("10");
const [categories, setCategories] = React.useState<any>();
const [dataTable, setDataTable] = React.useState<any[]>([]);
const [totalData, setTotalData] = React.useState<number>(1);
const [categoryFilter, setCategoryFilter] = React.useState<number[]>([]);
const [statusFilter, setStatusFilter] = React.useState<number[]>([]);
const [page, setPage] = React.useState(1);
const fetchData = async () => {
try {
setLoading(true);
const res = await listDataAdvertisements( page - 1,
showData,
"",
categoryFilter?.sort().join(","),
statusFilter?.sort().join(","));
const data = res?.data?.data;
const contentData = data?.content;
contentData.forEach((item: Advertisement, index: number) => {
item.no = index + 1;
});
setAds(contentData);
} catch (error) {
console.error("Error fetching advertisements:", error);
} finally {
setLoading(false);
}
};
useEffect(() => {
fetchData();
}, []);
return (
<div className="sticky top-0 space-y-4 ml-14">
{loading && <p className="text-sm text-gray-500">Loading...</p>}
{ads.map((ad) => (
<img key={ad.id} src={ad.imageUrl} alt={`Banner ${ad.id}`} width={180} />
))}
</div>
);
};
export default LeftBanner;

View File

@ -23,6 +23,7 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover"; import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
import PoldaLogo from "./polda-logo"; import PoldaLogo from "./polda-logo";
import { DynamicLogoPolda } from "./dynamic-logo-polda"; import { DynamicLogoPolda } from "./dynamic-logo-polda";
import { DynamicLogoSatker } from "./dynamic-logo-satker";
type Detail = { type Detail = {
id: number; id: number;
@ -162,7 +163,7 @@ const Navbar = () => {
<Link href={prefixPath} className="flex items-center"> <Link href={prefixPath} className="flex items-center">
<Image src="/assets/mediahub-logo.gif" alt="Media Hub Logo" width={2560} height={1440} className=" w-[200px] h-full shrink-0 object-contain" /> <Image src="/assets/mediahub-logo.gif" alt="Media Hub Logo" width={2560} height={1440} className=" w-[200px] h-full shrink-0 object-contain" />
</Link> </Link>
<DynamicLogoPolda /> <DynamicLogoPolda /> <DynamicLogoSatker />
{/* Nav Menu */} {/* Nav Menu */}
<div className="hidden custom-lg-button:flex items-center gap-5"> <div className="hidden custom-lg-button:flex items-center gap-5">
<NavigationMenu> <NavigationMenu>

View File

@ -19,13 +19,14 @@ import AreaCoverageWorkUnits from "./area-coverage-and-work-units";
import EventCalender from "./event-calender"; import EventCalender from "./event-calender";
import UserSurveyBox from "./survey-box"; import UserSurveyBox from "./survey-box";
import ScrollableContentPolda from "./scrollable-content-polda"; import ScrollableContentPolda from "./scrollable-content-polda";
import LeftBanner from "./left-banner";
const LeftBanner = () => ( // const LeftBanner = () => (
<div className="sticky top-0 space-y-4 ml-14"> // <div className="sticky top-0 space-y-4 ml-14">
<img src="/images/all-img/kiri1.png" alt="Banner Kiri 1" width={180} /> // <img src="/images/all-img/kiri1.png" alt="Banner Kiri 1" width={180} />
<img src="/images/all-img/kiri2.png" alt="Banner Kiri 2" width={180} /> // <img src="/images/all-img/kiri2.png" alt="Banner Kiri 2" width={180} />
</div> // </div>
); // );
const RightBanner = () => ( const RightBanner = () => (
<div className="sticky top-0 space-y-4"> <div className="sticky top-0 space-y-4">

View File

Before

Width:  |  Height:  |  Size: 116 KiB

After

Width:  |  Height:  |  Size: 116 KiB

View File

Before

Width:  |  Height:  |  Size: 392 KiB

After

Width:  |  Height:  |  Size: 392 KiB

View File

Before

Width:  |  Height:  |  Size: 268 KiB

After

Width:  |  Height:  |  Size: 268 KiB

View File

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 64 KiB

View File

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

View File

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

View File

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

View File

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 61 KiB

View File

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

View File

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 57 KiB

View File

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

View File

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 56 KiB

View File

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 57 KiB

View File

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 61 KiB

View File

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 67 KiB

View File

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

View File

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

View File

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB