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

fix: remove propsWhitChildren

Before 1 éve
szülő
commit
f003206563

+ 0 - 1
next.config.mjs

@@ -6,7 +6,6 @@ const withNextIntl = createNextIntlPlugin();
 /** @type {import('next').NextConfig} */
 const nextConfig = {
   reactStrictMode: true,
-  output: 'export',
   transpilePackages: ['antd-mobile'],
   sassOptions: {
     prependData: `@import "./src/styles/variables.scss";`

+ 69 - 71
src/app/[locale]/(ordinary)/profile/page.tsx

@@ -1,119 +1,117 @@
 "use client";
-import { FC, PropsWithChildren, useEffect, useState } from "react";
+import { getUserInfoApi, getUserMoneyApi } from "@/api/user";
 import { useRouter } from "@/i18n";
+import { useGlobalStore } from "@/stores";
 import clsx from "clsx";
+import { useTranslations } from "next-intl";
+import { FC, useEffect, useState } from "react";
 import ItemCom from "./component/ItemCom";
-import ModalCom from "./component/ModalCom";
 import MaskCom from "./component/MaskCom";
-import './page.scss'
-import { useGlobalStore } from '@/stores';
-import { getUserInfoApi, getUserMoneyApi } from "@/api/user";
-import { useTranslations } from "next-intl";
+import ModalCom from "./component/ModalCom";
+import "./page.scss";
 
 interface Props {}
 
-const Profile: FC<PropsWithChildren<Props>> = () => {
+const Profile: FC<Props> = () => {
     const t = useTranslations("ProfilePage");
-    
+
     const { token, userInfo, setUserInfo } = useGlobalStore();
     const userInfoRequest = async () => {
-        getUserInfoApi().then(res => {
-            res.code == 200 && setUserInfo(res.data)
-        })
-    }
+        getUserInfoApi().then((res) => {
+            res.code == 200 && setUserInfo(res.data);
+        });
+    };
 
     let [money, setMoney] = useState({
         deposit: 0,
-        point: 0
-    })
+        point: 0,
+    });
     const userMoneyRequest = async () => {
-        getUserMoneyApi().then(res => {
-            res.code == 200 && setMoney({
-                deposit: res.data.deposit,
-                point: res.data.point
-            })
-        })
-    }
+        getUserMoneyApi().then((res) => {
+            res.code == 200 &&
+                setMoney({
+                    deposit: res.data.deposit,
+                    point: res.data.point,
+                });
+        });
+    };
     useEffect(() => {
         if (token) {
-            userInfoRequest()
-            userMoneyRequest()
+            userInfoRequest();
+            userMoneyRequest();
         }
         // eslint-disable-next-line react-hooks/exhaustive-deps
-    }, [])
-    
+    }, []);
 
     const router = useRouter();
-    const goPage = (path = '/') => {
-        router.push(path)
-    }
+    const goPage = (path = "/") => {
+        router.push(path);
+    };
 
     const [visible, setVisible] = useState(false);
     const callbackFun = () => {
-        setVisible(!visible)
-    }
+        setVisible(!visible);
+    };
 
-    const divClassName = clsx('bgImg', token && 'default');
+    const divClassName = clsx("bgImg", token && "default");
     return (
         <div className="profile-box">
             <div className="userContent">
                 <div className="userInfo">
                     <div>
                         <div className={divClassName}></div>
-                        {
-                            token && (
-                                <div>
-                                    <span>{t('Conta')}</span>
-                                    <span className="phone">{userInfo?.user_phone || ''}</span>
-                                </div>
-                            )
-                        }
-                    </div>
-                    {
-                        !token && (
-                            <div className="goto" onClick={() => goPage('/login')}>
-                                <span>{t('Login')}</span>
-                                <span className="iconfont icon-xiangzuo1"></span>
+                        {token && (
+                            <div>
+                                <span>{t("Conta")}</span>
+                                <span className="phone">{userInfo?.user_phone || ""}</span>
                             </div>
-                        )
-                    }
-                    
+                        )}
+                    </div>
+                    {!token && (
+                        <div className="goto" onClick={() => goPage("/login")}>
+                            <span>{t("Login")}</span>
+                            <span className="iconfont icon-xiangzuo1"></span>
+                        </div>
+                    )}
                 </div>
-                { 
-                    token && (
-                        <div className="coin">
+                {token && (
+                    <div className="coin">
+                        <div>
+                            <span className="iconfont icon-icon-wallet"></span>
                             <div>
-                                <span className="iconfont icon-icon-wallet"></span>
-                                <div>
-                                    <span>{t('Saldo')}</span>
-                                    <div className="num">
-                                        <span className="uppercase">brl </span>
-                                        <span>{ money.deposit || 0.00 }</span>
-                                    </div>
+                                <span>{t("Saldo")}</span>
+                                <div className="num">
+                                    <span className="uppercase">brl </span>
+                                    <span>{money.deposit || 0.0}</span>
                                 </div>
                             </div>
+                        </div>
+                        <div>
+                            <span className="iconfont icon-gift2"></span>
                             <div>
-                                <span className="iconfont icon-gift2"></span>
-                                <div>
-                                    <span onClick={() => setVisible(true)}> {t('Bônus')} <img className="a" src="/img/a.png" alt=""/></span>
-                                    <div className="num">
-                                        <span className="uppercase">brl </span>
-                                        <span>{ money.point || 0.00 }</span>
-                                    </div>
+                                <span onClick={() => setVisible(true)}>
+                                    {" "}
+                                    {t("Bônus")} <img className="a" src="/img/a.png" alt="" />
+                                </span>
+                                <div className="num">
+                                    <span className="uppercase">brl </span>
+                                    <span>{money.point || 0.0}</span>
                                 </div>
                             </div>
                         </div>
-                    ) 
-                }
+                    </div>
+                )}
             </div>
 
             <div className="link">
-                <span onClick={() => goPage('/deposit')}>{t('Depósito')}</span>
-                <span onClick={() => goPage(token ? '/withdraw' : `/login?redirect=withdraw`)}>{t('Sacar')}</span>
+                <span onClick={() => goPage("/deposit")}>{t("Depósito")}</span>
+                <span onClick={() => goPage(token ? "/withdraw" : `/login?redirect=withdraw`)}>
+                    {t("Sacar")}
+                </span>
             </div>
             <ItemCom />
-            <ModalCom  />
-            <MaskCom visible={visible} callbackFun={(callbackFun)}/>
+            <ModalCom />
+            <MaskCom visible={visible} callbackFun={callbackFun} />
         </div>
     );
 };

+ 2 - 2
src/app/[locale]/affiliate/faq/page.tsx

@@ -1,10 +1,10 @@
 "use client";
 import { useTranslations } from "next-intl";
-import { FC, PropsWithChildren, useRef, useState } from "react";
+import { FC, useRef, useState } from "react";
 import "./page.scss";
 
 interface Props {}
-const App: FC<PropsWithChildren<Props>> = (props) => {
+const App: FC<Props> = (props) => {
     const t = useTranslations("FaqPage");
 
     const sliderRef = useRef<HTMLDivElement>(null);

+ 9 - 12
src/app/[locale]/affiliate/payments/page.tsx

@@ -1,14 +1,11 @@
-'use client'
-import { FC, PropsWithChildren } from "react";
-import { useRouter } from "@/i18n";
+"use client";
 import { useTranslations } from "next-intl";
-import HeaderCom from "../component/HeaderCom"
-import TabsCom from "../component/TabsCom"
-import './page.scss'
+import { FC } from "react";
+import "./page.scss";
 
-interface Props { }
-const App: FC<PropsWithChildren<Props>> = (props) => {
-    const t = useTranslations("PaymentsPage")
+interface Props {}
+const App: FC<Props> = (props) => {
+    const t = useTranslations("PaymentsPage");
     return (
         <div className="content">
             <div className="referralPayment referral-router-view">
@@ -26,6 +23,6 @@ const App: FC<PropsWithChildren<Props>> = (props) => {
                 </div>
             </div>
         </div>
-    )
-}
-export default App
+    );
+};
+export default App;

+ 15 - 14
src/app/[locale]/affiliate/referrals/page.tsx

@@ -1,14 +1,11 @@
-'use client'
-import { FC, PropsWithChildren, useEffect } from "react";
-import { useRouter } from "@/i18n";
+"use client";
 import { useTranslations } from "next-intl";
-import './page.scss'
-
-
-interface Props { }
-const App: FC<PropsWithChildren<Props>> = (props) => {
-    const t = useTranslations("ReferralsPage")
+import { FC } from "react";
+import "./page.scss";
 
+interface Props {}
+const App: FC<Props> = (props) => {
+    const t = useTranslations("ReferralsPage");
 
     return (
         <div className="content">
@@ -26,8 +23,12 @@ const App: FC<PropsWithChildren<Props>> = (props) => {
                     <li>
                         <div>#</div>
                         <div>{t("Conta")}</div>
-                        <div>{t("Apostas")}({t("R$")})</div>
-                        <div>{t("ApostaEquipe")}({t("R$")})</div>
+                        <div>
+                            {t("Apostas")}({t("R$")})
+                        </div>
+                        <div>
+                            {t("ApostaEquipe")}({t("R$")})
+                        </div>
                         <div>{t("Comissão")}</div>
                     </li>
                 </ul>
@@ -48,6 +49,6 @@ const App: FC<PropsWithChildren<Props>> = (props) => {
                 {/* 日历 */}
             </div>
         </div>
-    )
-}
-export default App
+    );
+};
+export default App;

+ 15 - 12
src/app/[locale]/affiliate/report/page.tsx

@@ -1,12 +1,11 @@
-'use client'
-import { FC, PropsWithChildren } from "react";
-import { useRouter } from '@/i18n'
+"use client";
 import { useTranslations } from "next-intl";
-import './page.scss'
+import { FC } from "react";
+import "./page.scss";
 
-interface Props { }
-const App: FC<PropsWithChildren<Props>> = (props) => {
-    const t = useTranslations("ReportPage")
+interface Props {}
+const App: FC<Props> = (props) => {
+    const t = useTranslations("ReportPage");
     return (
         <div className="content">
             <div className="report referral-router-view">
@@ -14,8 +13,12 @@ const App: FC<PropsWithChildren<Props>> = (props) => {
                     <li>
                         <div>#</div>
                         <div>{t("Conta")}</div>
-                        <div>{t("Apostas")}({t("R$")})</div>
-                        <div>{t("ApostaEquipe")}({t("R$")})</div>
+                        <div>
+                            {t("Apostas")}({t("R$")})
+                        </div>
+                        <div>
+                            {t("ApostaEquipe")}({t("R$")})
+                        </div>
                         <div>{t("Comissão")}</div>
                     </li>
                 </ul>
@@ -25,6 +28,6 @@ const App: FC<PropsWithChildren<Props>> = (props) => {
                 </div>
             </div>
         </div>
-    )
-}
-export default App
+    );
+};
+export default App;