|
@@ -2,12 +2,12 @@ import { ConfigType } from "@/api/config";
|
|
|
import { routing } from "@/i18n/routing";
|
|
|
import { server } from "@/utils/server";
|
|
|
import clsx from "clsx";
|
|
|
-import { Metadata, Viewport } from "next";
|
|
|
+import { Viewport } from "next";
|
|
|
import { NextIntlClientProvider } from "next-intl";
|
|
|
import { getMessages } from "next-intl/server";
|
|
|
import { Inter as FontSans } from "next/font/google";
|
|
|
import { notFound } from "next/navigation";
|
|
|
-import { ReactNode, Suspense } from "react";
|
|
|
+import { ReactNode } from "react";
|
|
|
import "../editor.scss";
|
|
|
import "../globals.scss";
|
|
|
import { Providers } from "./providers";
|
|
@@ -19,32 +19,32 @@ const fontSans = FontSans({
|
|
|
});
|
|
|
export const viewport: Viewport = {};
|
|
|
|
|
|
-export const metadata: Metadata = {
|
|
|
- title: {
|
|
|
- template: "%s | BCWin777",
|
|
|
- default: "BCWin777",
|
|
|
- },
|
|
|
- keywords: ["BCWin777"],
|
|
|
-
|
|
|
- description: "The home of over 30 million players",
|
|
|
- appleWebApp: {
|
|
|
- statusBarStyle: "black",
|
|
|
- },
|
|
|
-
|
|
|
- formatDetection: {
|
|
|
- email: false,
|
|
|
- address: false,
|
|
|
- telephone: false,
|
|
|
- },
|
|
|
-
|
|
|
- referrer: "no-referrer",
|
|
|
- other: {
|
|
|
- viewport: [
|
|
|
- "width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0," +
|
|
|
- " viewport-fit=cover ",
|
|
|
- ],
|
|
|
- },
|
|
|
-};
|
|
|
+// export const metadata: Metadata = {
|
|
|
+// title: {
|
|
|
+// template: "%s | BCWin777",
|
|
|
+// default: "BCWin777",
|
|
|
+// },
|
|
|
+// keywords: ["BCWin777"],
|
|
|
+//
|
|
|
+// description: "The home of over 30 million players",
|
|
|
+// appleWebApp: {
|
|
|
+// statusBarStyle: "black",
|
|
|
+// },
|
|
|
+//
|
|
|
+// formatDetection: {
|
|
|
+// email: false,
|
|
|
+// address: false,
|
|
|
+// telephone: false,
|
|
|
+// },
|
|
|
+//
|
|
|
+// referrer: "no-referrer",
|
|
|
+// other: {
|
|
|
+// viewport: [
|
|
|
+// "width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0," +
|
|
|
+// " viewport-fit=cover ",
|
|
|
+// ],
|
|
|
+// },
|
|
|
+// };
|
|
|
|
|
|
interface Og {
|
|
|
description: string;
|
|
@@ -62,6 +62,47 @@ const getSystemReq = () => {
|
|
|
method: "POST",
|
|
|
});
|
|
|
};
|
|
|
+export const generateMetadata = async () => {
|
|
|
+ const { data } = await getSystemReq();
|
|
|
+ return {
|
|
|
+ title: {
|
|
|
+ template: "%s | BCWin777",
|
|
|
+ default: "BCWin777",
|
|
|
+ },
|
|
|
+ keywords: ["BCWin777"],
|
|
|
+
|
|
|
+ description: "The home of over 30 million players",
|
|
|
+ appleWebApp: {
|
|
|
+ statusBarStyle: "black",
|
|
|
+ },
|
|
|
+
|
|
|
+ formatDetection: {
|
|
|
+ email: false,
|
|
|
+ address: false,
|
|
|
+ telephone: false,
|
|
|
+ },
|
|
|
+
|
|
|
+ referrer: "no-referrer",
|
|
|
+ other: {
|
|
|
+ viewport: [
|
|
|
+ "width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0," +
|
|
|
+ " viewport-fit=cover ",
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ openGraph: {
|
|
|
+ title: data?.og?.title,
|
|
|
+ description: data?.og?.description,
|
|
|
+ image: data?.og?.url,
|
|
|
+ url: data?.og?.address,
|
|
|
+ },
|
|
|
+ twitter: {
|
|
|
+ card: data?.og?.address,
|
|
|
+ title: data?.og?.title,
|
|
|
+ description: data?.og?.description,
|
|
|
+ image: data?.og?.url,
|
|
|
+ },
|
|
|
+ };
|
|
|
+};
|
|
|
export default async function LocaleLayout({
|
|
|
children,
|
|
|
params: { locale },
|
|
@@ -73,36 +114,11 @@ export default async function LocaleLayout({
|
|
|
notFound();
|
|
|
}
|
|
|
const messages = await getMessages();
|
|
|
-
|
|
|
- const { data } = await getSystemReq();
|
|
|
- // console.log(data)
|
|
|
return (
|
|
|
<html lang={locale} suppressHydrationWarning>
|
|
|
- <head>
|
|
|
- {/* <!-- SEO Metadata --> */}
|
|
|
- {/* <meta name="description" content="{{ .Description }}" />
|
|
|
- <meta name="keywords" content="{{ .Keywords }}" />
|
|
|
- <meta name="author" content="Besoft" />
|
|
|
- <meta name="viewport" content="width=device-width, initial-scale=1.0" /> */}
|
|
|
-
|
|
|
- {/* <!-- Open Graph Metadata --> */}
|
|
|
- <meta property="og:title" content={data?.og?.title || ""} />
|
|
|
- <meta property="og:description" content={data?.og?.description || ""} />
|
|
|
- <meta property="og:image" content={data?.og?.url || ""} />
|
|
|
- <meta property="og:url" content={data?.og?.address || ""} />
|
|
|
- <meta property="og:type" content="website" />
|
|
|
-
|
|
|
- {/* <!-- Twitter Card Metadata --> */}
|
|
|
- <meta name="twitter:card" content={data?.og?.address || ""} />
|
|
|
- <meta name="twitter:title" content={data?.og?.title || ""} />
|
|
|
- <meta name="twitter:description" content={data?.og?.description || ""} />
|
|
|
- <meta name="twitter:image" content={data?.og?.url || ""} />
|
|
|
- </head>
|
|
|
<body className={clsx("font-sans", fontSans.variable)}>
|
|
|
<NextIntlClientProvider messages={messages}>
|
|
|
- <Providers themeProps={{ attribute: "class" }}>
|
|
|
- {children}
|
|
|
- </Providers>
|
|
|
+ <Providers themeProps={{ attribute: "class" }}>{children}</Providers>
|
|
|
</NextIntlClientProvider>
|
|
|
</body>
|
|
|
</html>
|