Parcourir la source

feat: 顶部添加nobouns

year il y a 2 mois
Parent
commit
75420f5623
2 fichiers modifiés avec 11 ajouts et 0 suppressions
  1. BIN
      public/img/no_bouns.png
  2. 11 0
      src/components/HeaderBack/index.tsx

BIN
public/img/no_bouns.png


+ 11 - 0
src/components/HeaderBack/index.tsx

@@ -1,10 +1,12 @@
 "use client";
 import { usePathname, useRouter } from "@/i18n/routing";
+import { useWalletStore } from "@/stores/useWalletStore";
 import clsx from "clsx";
 import { useTranslations } from "next-intl";
 import { FC, PropsWithChildren, ReactNode, useEffect, useState } from "react";
 import styles from "./style.module.scss";
 
+import { getToken } from "@/utils/Cookies";
 import clearCache from "./actions";
 
 /**
@@ -32,6 +34,7 @@ const HeaderBack: FC<PropsWithChildren<HeaderBackProps>> = ({
     Right,
 }) => {
     const t = useTranslations("HeaderBack");
+    const wallet = useWalletStore((state) => state.wallet);
 
     const iconClassName1 = clsx(
         {
@@ -81,6 +84,14 @@ const HeaderBack: FC<PropsWithChildren<HeaderBackProps>> = ({
                 {(title || selfTitle) && <span>{title || selfTitle}</span>}
             </div>
             <div className={styles.content}>{children}</div>
+            {getToken() && (
+                <div>
+                    {!wallet.is_open_no_bonus && (
+                        <img src="/img/no_bouns.png" alt="" className="h-[20px]" />
+                    )}
+                </div>
+            )}
+
             {!Right && (
                 <span className={styles.right} onClick={() => goPage("home")}>
                     <span className={iconClassName2}></span>