diff --git a/app/static/[slug]/page.tsx b/app/static/[slug]/page.tsx index 78e091a..5f66a99 100644 --- a/app/static/[slug]/page.tsx +++ b/app/static/[slug]/page.tsx @@ -2,23 +2,24 @@ import { HumasLayout } from "@/components/layout/humas-layout"; import { getCustomStaticDetailBySlug } from "@/service/static-page-service"; -import { Card } from "@nextui-org/react"; +import { Card, CircularProgress } from "@nextui-org/react"; import { useParams } from "next/navigation"; import { useEffect, useState } from "react"; export default function StaticPage() { const params = useParams(); const slug = params.slug; - const [htmlBody, setHtmlBody] = useState(""); + const [customData, setCustomData] = useState(); useEffect(() => { + setCustomData(undefined); initFetch(); }, [slug]); const initFetch = async () => { const res = await getCustomStaticDetailBySlug(slug ? String(slug) : ""); const data = res?.data?.data; - setHtmlBody(data?.htmlBody); + setCustomData(data); }; const [hasMounted, setHasMounted] = useState(false); @@ -30,9 +31,26 @@ export default function StaticPage() { if (!hasMounted) return null; return ( - -
- + {customData ? ( + <> +
+
+ +
+
+ {customData?.title} +
+
+ +
+
+
+
+
+ + ) : ( +
NO DATA
+ )} ); } diff --git a/components/form/static-page/static-page-edit-form.tsx b/components/form/static-page/static-page-edit-form.tsx index 3fcd331..a079dfc 100644 --- a/components/form/static-page/static-page-edit-form.tsx +++ b/components/form/static-page/static-page-edit-form.tsx @@ -158,7 +158,6 @@ export default function StaticPageBuilderEdit() { value={value} onChange={onChange} labelPlacement="outside" - readOnly className="w-full" variant="bordered" /> diff --git a/components/layout/navbar/NavbarHumas.tsx b/components/layout/navbar/NavbarHumas.tsx index eaf7312..7fe3c2c 100644 --- a/components/layout/navbar/NavbarHumas.tsx +++ b/components/layout/navbar/NavbarHumas.tsx @@ -58,11 +58,11 @@ export default function NavbarHumas() { const token = Cookies.get("access_token"); const isAuthenticated = Cookies.get("is_authenticated"); - useEffect(() => { - if (!isAuthenticated) { - onLogout(); - } - }, [token]); + // useEffect(() => { + // if (!isAuthenticated) { + // onLogout(); + // } + // }, [token]); const onLogout = () => { Object.keys(Cookies.get()).forEach((cookieName) => { @@ -191,7 +191,7 @@ export default function NavbarHumas() { Profile Pimpinan POLRI @@ -200,7 +200,7 @@ export default function NavbarHumas() { Struktur Organisasi @@ -208,14 +208,17 @@ export default function NavbarHumas() { - + Visi & Misi Tugas & Fungsi @@ -223,7 +226,7 @@ export default function NavbarHumas() { - + Logo diff --git a/components/main/static-page/static-page-main.tsx b/components/main/static-page/static-page-main.tsx index e318432..f7d6a82 100644 --- a/components/main/static-page/static-page-main.tsx +++ b/components/main/static-page/static-page-main.tsx @@ -95,12 +95,12 @@ export default function StaticPageBuilder() { } }); } - const title = watch("title"); - useEffect(() => { - if (getValues("title")) { - setValue("slug", createSlug(getValues("title"))); - } - }, [title]); + // const title = watch("title"); + // useEffect(() => { + // if (getValues("title")) { + // setValue("slug", createSlug(getValues("title"))); + // } + // }, [title]); return (
diff --git a/public/divhumas.png b/public/divhumas.png new file mode 100644 index 0000000..c759f32 Binary files /dev/null and b/public/divhumas.png differ diff --git a/public/struktur-humas.png b/public/struktur-humas.png new file mode 100644 index 0000000..8aa85bc Binary files /dev/null and b/public/struktur-humas.png differ diff --git a/public/tribrata.png b/public/tribrata.png new file mode 100644 index 0000000..aa5d25e Binary files /dev/null and b/public/tribrata.png differ