Forráskód Böngészése

fix: 修改layout

Before 9 hónapja
szülő
commit
94b39f1e7f

+ 7 - 0
src/app/[locale]/(TabBar)/sports/layout.tsx → src/app/[locale]/(TabBar)/(ordinary)/deposit/layout.tsx

@@ -1,6 +1,13 @@
 import Header from "@/components/Header";
 import { FC, PropsWithChildren } from "react";
 type Props = {};
+
+// export const generateMetadata = (props: any) => {
+//     console.log(`🚀🚀🚀🚀🚀-> in layout.tsx on 6`, props);
+//     return {
+//         title: "Sport",
+//     };
+// };
 const Layout: FC<PropsWithChildren<Props>> = (props) => {
     const { children } = props;
 

+ 22 - 0
src/app/[locale]/(TabBar)/(ordinary)/gameList/layout.tsx

@@ -0,0 +1,22 @@
+import Header from "@/components/Header";
+import { FC, PropsWithChildren } from "react";
+type Props = {};
+
+// export const generateMetadata = (props: any) => {
+//     console.log(`🚀🚀🚀🚀🚀-> in layout.tsx on 6`, props);
+//     return {
+//         title: "Sport",
+//     };
+// };
+const Layout: FC<PropsWithChildren<Props>> = (props) => {
+    const { children } = props;
+
+    return (
+        <>
+            <Header visibleLanguage={false} />
+            <main className={"main-footer-header"}>{children}</main>
+        </>
+    );
+};
+
+export default Layout;

+ 18 - 12
src/app/[locale]/(TabBar)/(ordinary)/layout.tsx

@@ -1,16 +1,22 @@
-import HeaderBack from "@/components/HeaderBack";
-import { ReactNode } from "react";
-export default async function LocaleLayout({
-    children,
-    params: { locale },
-}: {
-    children: ReactNode;
-    params: { locale: string };
-}) {
+import Header from "@/components/Header";
+import { FC, PropsWithChildren } from "react";
+type Props = {};
+
+// export const generateMetadata = (props: any) => {
+//     console.log(`🚀🚀🚀🚀🚀-> in layout.tsx on 6`, props);
+//     return {
+//         title: "Sport",
+//     };
+// };
+const Layout: FC<PropsWithChildren<Props>> = (props) => {
+    const { children } = props;
+
     return (
         <>
-            <HeaderBack showBack={true} />
-            <main className={"main-footer-header bg-[#1f1f1f]"}>{children}</main>
+            <Header visibleLanguage={false} />
+            <main className={"main-footer-header"}>{children}</main>
         </>
     );
-}
+};
+
+export default Layout;

+ 16 - 0
src/app/[locale]/(TabBar)/(ordinary)/profile/layout.tsx

@@ -0,0 +1,16 @@
+import HeaderBack from "@/components/HeaderBack";
+import { ReactNode } from "react";
+export default async function LocaleLayout({
+    children,
+    params: { locale },
+}: {
+    children: ReactNode;
+    params: { locale: string };
+}) {
+    return (
+        <>
+            <HeaderBack showBack={true} />
+            <main className={"main-footer-header bg-[#1f1f1f]"}>{children}</main>
+        </>
+    );
+}

+ 10 - 12
src/app/[locale]/(TabBar)/layout.tsx

@@ -1,22 +1,20 @@
-"use client";
 import Footer from "@/components/Footer";
-import { usePathname } from "@/i18n";
-import { FC, PropsWithChildren, useEffect } from "react";
+import { getTranslations } from "next-intl/server";
+import { FC, PropsWithChildren } from "react";
 type Props = {};
+
+export const generateMetadata = async () => {
+    const t = await getTranslations("titles");
+    return {
+        title: t("home"),
+    };
+};
 const Layout: FC<PropsWithChildren<Props>> = (props) => {
     const { children } = props;
-
-    // 获取分享id
-    const pathname = usePathname();
-    useEffect(() => {
-        const [, shareId] = pathname.split("/");
-        if (!shareId || shareId === "xxxxxx") return;
-        sessionStorage.setItem("shareId", shareId);
-    }, []);
     return (
         <>
             <main className={"main-footer"}>{children}</main>
-            <Footer></Footer>
+            <Footer />
         </>
     );
 };