From 87b57f1442ded81965ca9a477d1d680f84ef2857 Mon Sep 17 00:00:00 2001 From: Sabda Yagra Date: Wed, 26 Mar 2025 15:07:52 +0700 Subject: [PATCH] fix detail content tbnews --- .../[polda_name]/components/contact-us.tsx | 2 +- .../[polda_name]/components/hero-kaltara.tsx | 87 +++++++++++++++---- .../components/navbar-kaltara.tsx | 5 +- .../[polda_name]/components/pps-section.tsx | 2 +- .../{video => image}/detail/[slug]/layout.tsx | 0 .../{video => image}/detail/[slug]/page.tsx | 17 +++- 6 files changed, 86 insertions(+), 27 deletions(-) rename app/[locale]/(public)/(polda)/tbnews/[polda_name]/{video => image}/detail/[slug]/layout.tsx (100%) rename app/[locale]/(public)/(polda)/tbnews/[polda_name]/{video => image}/detail/[slug]/page.tsx (98%) diff --git a/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/contact-us.tsx b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/contact-us.tsx index f3935010..69a4b659 100644 --- a/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/contact-us.tsx +++ b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/contact-us.tsx @@ -5,7 +5,7 @@ import React from "react"; const ContactUs = () => { return ( -
+
{/* Logo */} diff --git a/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/hero-kaltara.tsx b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/hero-kaltara.tsx index 381c280d..4e1a7a16 100644 --- a/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/hero-kaltara.tsx +++ b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/hero-kaltara.tsx @@ -1,6 +1,7 @@ "use client"; import { Reveal } from "@/components/landing-page/Reveal"; +import { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious } from "@/components/ui/carousel"; import { Icon } from "@/components/ui/icon"; import { Skeleton } from "@/components/ui/skeleton"; import { Link } from "@/i18n/routing"; @@ -12,6 +13,7 @@ import React, { useEffect, useState } from "react"; const HeroKaltara = () => { const params = useParams(); + const locale = params?.locale; const [content, setContent] = useState([]); const [centerPadding, setCenterPadding] = useState(); const [isBannerLoading, setIsBannerLoading] = useState(true); @@ -111,37 +113,84 @@ const HeroKaltara = () => { ], }; + const shimmer = (w: number, h: number) => ` + + + + + + + + + + + + `; + + const toBase64 = (str: string) => (typeof window === "undefined" ? Buffer.from(str).toString("base64") : window.btoa(str)); + return ( <>
{isBannerLoading ? ( + //
+ // + //
+ // + // + //
+ //
- +
) : ( -
- {content?.slice(0, 1)?.map((row: any, index: number) => ( -
- - gambar-utama - -

{row.title}

-
-

{row?.categoryName}

-

- {getPublicLocaleTimestamp(new Date(row?.createdAt))} - {/* {row?.createdAt} */} -

-
-

-

- ))} -
+ //
+ // {content?.slice(0, 1)?.map((row: any, index: number) => ( + //
+ // + // gambar-utama + // + //

{row.title}

+ //
+ //

{row?.categoryName}

+ //

+ // {getPublicLocaleTimestamp(new Date(row?.createdAt))} + // {/* {row?.createdAt} */} + //

+ //
+ //

+ //

+ // ))} + //
+ + + {content?.map((row: any) => ( + +
+ + gambar-utama + +

{row.title}

+
+

{row?.categoryName}

+

+ {getPublicLocaleTimestamp(new Date(row?.createdAt))} + {/* {row?.createdAt} */} +

+
+

+

+
+ ))} +
+ + +
)} {isBannerLoading ? ( diff --git a/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/navbar-kaltara.tsx b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/navbar-kaltara.tsx index 08283155..9fa94e0d 100644 --- a/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/navbar-kaltara.tsx +++ b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/navbar-kaltara.tsx @@ -44,7 +44,7 @@ const categoryLinks: any = { Kesehatan: "https://tribratanews.kaltara.polri.go.id/category/kesehatan/", Olahraga: "https://tribratanews.kaltara.polri.go.id/category/olahraga/", PPA: "https://tribratanews.kaltara.polri.go.id/category/ppa/", - MediaHub: "https://new.netidhub.com/", + MediaHub: "https://new.netidhub.com/in/polda/kaltara", }; const NavbarKaltara = () => { @@ -53,10 +53,11 @@ const NavbarKaltara = () => { return (
-
+
image +
{category?.map((data: any) => ( diff --git a/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/pps-section.tsx b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/pps-section.tsx index 9ab2ee42..3711bf32 100644 --- a/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/pps-section.tsx +++ b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/pps-section.tsx @@ -29,7 +29,7 @@ const PpsSection = () => { {image?.map((news: any, index) => ( - pps + pps {/*
diff --git a/app/[locale]/(public)/(polda)/tbnews/[polda_name]/video/detail/[slug]/layout.tsx b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/image/detail/[slug]/layout.tsx similarity index 100% rename from app/[locale]/(public)/(polda)/tbnews/[polda_name]/video/detail/[slug]/layout.tsx rename to app/[locale]/(public)/(polda)/tbnews/[polda_name]/image/detail/[slug]/layout.tsx diff --git a/app/[locale]/(public)/(polda)/tbnews/[polda_name]/video/detail/[slug]/page.tsx b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/image/detail/[slug]/page.tsx similarity index 98% rename from app/[locale]/(public)/(polda)/tbnews/[polda_name]/video/detail/[slug]/page.tsx rename to app/[locale]/(public)/(polda)/tbnews/[polda_name]/image/detail/[slug]/page.tsx index a00047f4..dfe60185 100644 --- a/app/[locale]/(public)/(polda)/tbnews/[polda_name]/video/detail/[slug]/page.tsx +++ b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/image/detail/[slug]/page.tsx @@ -619,7 +619,7 @@ const DetailInfo = () => { return ( <> -
+
{/* Bagian Kiri */}
@@ -630,7 +630,16 @@ const DetailInfo = () => {
) : (
- Main + {/* Main */} + 0 ? detailDataImage.files[selectedImage]?.url : detailDataImage?.thumbnailLink} + alt="Main" + className="rounded-lg w-auto h-fit" + /> +
)} @@ -793,9 +802,9 @@ const DetailInfo = () => {
-
+
{/* Comment */} -
+

{t("comment")}