fix meta data
This commit is contained in:
parent
9e61990f39
commit
a2c04393db
|
|
@ -1,5 +1,4 @@
|
|||
// RootLayout.tsx
|
||||
"use client";
|
||||
import { fontSans } from "@/config/fonts";
|
||||
import { siteConfig } from "@/config/site";
|
||||
import { Inter } from "next/font/google";
|
||||
|
|
@ -10,7 +9,7 @@ import { Metadata } from "next";
|
|||
import { Providers } from "./providers";
|
||||
import LoadScript from "@/utils/global";
|
||||
import { NextIntlClientProvider } from "next-intl";
|
||||
import { useEffect, useState, type ReactNode } from "react";
|
||||
import { type ReactNode } from "react";
|
||||
import storedLanguage from "@/store/language-store";
|
||||
const inter = Inter({ subsets: ["latin"] });
|
||||
|
||||
|
|
@ -32,27 +31,12 @@ const inter = Inter({ subsets: ["latin"] });
|
|||
// };
|
||||
|
||||
export default function RootLayout({ children }: { children: ReactNode }) {
|
||||
const [localeNow, setLocaleNow] = useState<string>("id");
|
||||
|
||||
const locale = storedLanguage((state) => state.locale);
|
||||
|
||||
useEffect(() => {
|
||||
if (locale) {
|
||||
setLocaleNow(locale);
|
||||
}
|
||||
}, [locale]);
|
||||
|
||||
const [messages, setMessages] = useState<any>(null);
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
const loadedMessages = (await import(`../messages/${locale}.json`))
|
||||
.default;
|
||||
setMessages(loadedMessages);
|
||||
})();
|
||||
}, [locale]);
|
||||
return (
|
||||
<html lang="en" suppressHydrationWarning className="scroll-smooth">
|
||||
<head>
|
||||
<title>
|
||||
DIVISI HUMAS POLRI - Pengelolaan Informasi & Dokumentasi Polri
|
||||
</title>
|
||||
<meta
|
||||
name="theme-color"
|
||||
content="white"
|
||||
|
|
@ -71,11 +55,9 @@ export default function RootLayout({ children }: { children: ReactNode }) {
|
|||
<body
|
||||
className={clsx("bg-background font-sans antialiased", inter.className)}
|
||||
>
|
||||
<NextIntlClientProvider locale={localeNow} messages={messages}>
|
||||
<Providers themeProps={{ attribute: "class", defaultTheme: "light" }}>
|
||||
<main className="">{children}</main>
|
||||
</Providers>
|
||||
</NextIntlClientProvider>
|
||||
<Providers themeProps={{ attribute: "class", defaultTheme: "light" }}>
|
||||
<main className="">{children}</main>
|
||||
</Providers>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
|
|
|
|||
14
app/page.tsx
14
app/page.tsx
|
|
@ -1,24 +1,12 @@
|
|||
"use client";
|
||||
import BannerHumasNew from "@/components/landing/banner-new";
|
||||
import BannerHumas from "@/components/landing/BannerHumas";
|
||||
import BodyLayout from "@/components/landing/BodyLayout";
|
||||
import AnalyticDrawer from "@/components/landing/drawer";
|
||||
import FooterNew from "@/components/landing/footer-new";
|
||||
import HeaderNews from "@/components/landing/HeaderNews";
|
||||
import NewsTicker from "@/components/landing/NewsTicker";
|
||||
import { HumasLayout } from "@/components/layout/humas-layout";
|
||||
import { Suspense, useEffect, useState } from "react";
|
||||
import { Suspense } from "react";
|
||||
|
||||
export default function Home() {
|
||||
const [hasMounted, setHasMounted] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
setHasMounted(true);
|
||||
}, []);
|
||||
|
||||
// Render
|
||||
if (!hasMounted) return null;
|
||||
|
||||
return (
|
||||
<>
|
||||
<section className="flex flex-col">
|
||||
|
|
|
|||
|
|
@ -1,21 +1,43 @@
|
|||
"use client";
|
||||
import * as React from "react";
|
||||
import { HeroUIProvider } from "@heroui/system";
|
||||
import { useRouter } from 'next/navigation'
|
||||
import { useRouter } from "next/navigation";
|
||||
import { ThemeProvider as NextThemesProvider } from "next-themes";
|
||||
import { ThemeProviderProps } from "next-themes/dist/types";
|
||||
import { NextIntlClientProvider } from "next-intl";
|
||||
import storedLanguage from "@/store/language-store";
|
||||
|
||||
export interface ProvidersProps {
|
||||
children: React.ReactNode;
|
||||
themeProps?: ThemeProviderProps;
|
||||
children: React.ReactNode;
|
||||
themeProps?: ThemeProviderProps;
|
||||
}
|
||||
|
||||
export function Providers({ children, themeProps }: ProvidersProps) {
|
||||
const router = useRouter();
|
||||
const router = useRouter();
|
||||
const [localeNow, setLocaleNow] = React.useState<string>("id");
|
||||
const [messages, setMessages] = React.useState<any>(null);
|
||||
|
||||
return (
|
||||
<HeroUIProvider navigate={router.push}>
|
||||
<NextThemesProvider {...themeProps}>{children}</NextThemesProvider>
|
||||
</HeroUIProvider>
|
||||
);
|
||||
const locale = storedLanguage((state) => state.locale);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (locale) {
|
||||
setLocaleNow(locale);
|
||||
}
|
||||
}, [locale]);
|
||||
|
||||
React.useEffect(() => {
|
||||
(async () => {
|
||||
const loadedMessages = (await import(`../messages/${locale}.json`))
|
||||
.default;
|
||||
setMessages(loadedMessages);
|
||||
})();
|
||||
}, [locale]);
|
||||
|
||||
return (
|
||||
<NextIntlClientProvider locale={locale} messages={messages}>
|
||||
<HeroUIProvider navigate={router.push}>
|
||||
<NextThemesProvider {...themeProps}>{children}</NextThemesProvider>
|
||||
</HeroUIProvider>
|
||||
</NextIntlClientProvider>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -233,7 +233,7 @@ export default function BannerHumasNew() {
|
|||
<div className="flex justify-between items-center mb-10">
|
||||
<div className="flex flex-col gap-1 justify-start items-start">
|
||||
<p className="text-lg lg:text-5xl font-bold text-left leading-0">
|
||||
SELAMAT DATANG DI WEBSITE RESMI DIVISI HUMAS POLRI
|
||||
{t("welcome")}
|
||||
</p>
|
||||
<p className="text-xs lg:text-base">
|
||||
OBYEKTIF - DIPERCAYA - PARTISIPASI
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
"use client";
|
||||
import { Button } from "@heroui/button";
|
||||
import {
|
||||
Drawer,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
"use client";
|
||||
import { Button } from "@heroui/button";
|
||||
import { Input } from "@heroui/input";
|
||||
import {
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ export const Navbar = () => {
|
|||
}}
|
||||
>
|
||||
<NavbarBrand className="min-w-max">
|
||||
<Image src="/logohumas.png" />
|
||||
<Image src="/logohumas.png" alt="humas-polri" />
|
||||
</NavbarBrand>
|
||||
<NavbarContent
|
||||
className="hidden md:flex basis-3/5 gap-0 md:gap-4 lg:gap-12 px-auto lg:px-10"
|
||||
|
|
|
|||
|
|
@ -18,7 +18,8 @@
|
|||
},
|
||||
"Banner": {
|
||||
"jumbotron": "TRANSPARENCY, PARTICIPATION, AND THE BEST SERVICES FROM POLRI FOR INDONESIA",
|
||||
"phrase": "Providing Trusted Information and Bringing Polri Closer to the Community"
|
||||
"phrase": "Providing Trusted Information and Bringing Polri Closer to the Community",
|
||||
"welcome": "WELCOME TO THE OFFICIAL WEBSITE OF THE POLICE PUBLIC RELATIONS DIVISION"
|
||||
},
|
||||
"Footer": {},
|
||||
"LandingInformasiPublik": {
|
||||
|
|
|
|||
|
|
@ -18,7 +18,8 @@
|
|||
},
|
||||
"Banner": {
|
||||
"jumbotron": "TRANSPARANSI, PARTISIPASI, DAN LAYANAN TERBAIK DARI POLRI UNTUK INDONESIA",
|
||||
"phrase": "Menyajikan Informasi Terpercaya dan Mendekatkan Polri dengan Masyarakat"
|
||||
"phrase": "Menyajikan Informasi Terpercaya dan Mendekatkan Polri dengan Masyarakat",
|
||||
"welcome": "SELAMAT DATANG DI WEBSITE RESMI DIVISI HUMAS POLRI"
|
||||
},
|
||||
"LandingInformasiPublik": {
|
||||
"InformasiPublik": "Informasi Publik",
|
||||
|
|
|
|||
|
|
@ -3,6 +3,9 @@ const nextConfig = {
|
|||
eslint: {
|
||||
ignoreDuringBuilds: true,
|
||||
},
|
||||
experimental: {
|
||||
serverActions: true,
|
||||
},
|
||||
images: {
|
||||
remotePatterns: [
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue