瀏覽代碼

add top tip

lyf 1 年之前
父節點
當前提交
9858d1f958
共有 3 個文件被更改,包括 25 次插入24 次删除
  1. 7 5
      app/components/auth.tsx
  2. 18 18
      app/icons/logo.svg
  3. 0 1
      app/icons/www-delete.svg

+ 7 - 5
app/components/auth.tsx

@@ -5,12 +5,13 @@ import { useNavigate } from "react-router-dom";
 import { Path, SAAS_CHAT_URL } from "../constant";
 import { useAccessStore } from "../store";
 import Locale from "../locales";
-import Delete from "../icons/www-delete.svg";
+import Delete from "../icons/close.svg";
 import Arrow from "../icons/arrow.svg";
 import Logo from "../icons/logo.svg";
 import BotIcon from "../icons/bot.svg";
 import { getClientConfig } from "../config/client";
 import LeftIcon from "@/app/icons/left.svg";
+import { safeLocalStorage } from "@/app/utils";
 
 export function AuthPage() {
   const navigate = useNavigate();
@@ -112,20 +113,21 @@ export function AuthPage() {
 function TopBanner() {
   const [isHovered, setIsHovered] = useState(false);
   const [isVisible, setIsVisible] = useState(true);
+  const storage = safeLocalStorage();
 
   useEffect(() => {
     // 检查 localStorage 中是否有标记
-    const bannerDismissed = localStorage.getItem("bannerDismissed");
+    const bannerDismissed = storage.getItem("bannerDismissed");
 
     // 如果标记不存在,存储默认值并显示横幅
     if (!bannerDismissed) {
-      localStorage.setItem("bannerDismissed", "false");
+      storage.setItem("bannerDismissed", "false");
       setIsVisible(true); // 显示横幅
     } else if (bannerDismissed === "true") {
       // 如果标记为 "true",则隐藏横幅
       setIsVisible(false);
     }
-  }, []);
+  }, [storage]);
 
   const handleMouseEnter = () => {
     setIsHovered(true);
@@ -137,7 +139,7 @@ function TopBanner() {
 
   const handleClose = () => {
     setIsVisible(false);
-    localStorage.setItem("bannerDismissed", "true");
+    storage.setItem("bannerDismissed", "true");
   };
 
   if (!isVisible) {

+ 18 - 18
app/icons/logo.svg

@@ -1,19 +1,19 @@
-<svg width="29.47" height="32" viewBox="0 0 221 240" fill="none" xmlns="http://www.w3.org/2000/svg">
-    <rect x="160.697" y="38.125" width="65.0066" height="145.932" rx="32.5033" transform="rotate(21.9872 160.697 38.125)" fill="url(#paint0_linear_29_636)"/>
-    <path fill-rule="evenodd" clip-rule="evenodd" d="M48.642 79.1254L22.7227 150.338C16.583 167.207 25.2805 185.858 42.149 191.998C59.0175 198.138 77.6692 189.44 83.8089 172.572L94.23 143.94L57.5725 106.501C51.4419 100.24 48.1071 91.7636 48.3277 83.0037C48.3611 81.6783 48.4675 80.3849 48.642 79.1254Z" fill="url(#paint1_linear_29_636)"/>
-    <path d="M172.578 132.787C178.767 139.294 182.013 148.056 181.559 157.025C180.101 185.773 144.937 198.803 125.099 177.945L57.4545 106.823C51.2658 100.316 48.0192 91.5538 48.4738 82.5853C49.9312 53.8366 85.0957 40.8072 104.934 61.6652L172.578 132.787Z" fill="url(#paint2_linear_29_636)" fill-opacity="0.96"/>
-    <defs>
-        <linearGradient id="paint0_linear_29_636" x1="215.063" y1="59.6276" x2="160.714" y2="157.96" gradientUnits="userSpaceOnUse">
-            <stop stop-color="#3EADFE"/>
-            <stop offset="1" stop-color="#2A7AFF"/>
-        </linearGradient>
-        <linearGradient id="paint1_linear_29_636" x1="105.376" y1="84.4161" x2="19.7452" y2="131.163" gradientUnits="userSpaceOnUse">
-            <stop stop-color="#01B3FF"/>
-            <stop offset="1" stop-color="#59ECFA"/>
-        </linearGradient>
-        <linearGradient id="paint2_linear_29_636" x1="102.734" y1="136.396" x2="192.577" y2="155.859" gradientUnits="userSpaceOnUse">
-            <stop stop-color="#023BFF" stop-opacity="0.82"/>
-            <stop offset="0.880409" stop-color="#2D86FF" stop-opacity="0.76"/>
-        </linearGradient>
-    </defs>
+<svg width="38.73" height="42" viewBox="0 0 221 240" fill="none" xmlns="http://www.w3.org/2000/svg">
+  <rect x="160.697" y="38.125" width="65.007" height="145.932" rx="32.503" transform="rotate(21.987 160.697 38.125)" fill="url(#logo_svg__a)"></rect>
+  <path fill-rule="evenodd" clip-rule="evenodd" d="m48.642 79.125-25.92 71.213c-6.139 16.869 2.558 35.52 19.427 41.66 16.868 6.14 35.52-2.558 41.66-19.426L94.23 143.94l-36.658-37.439a32.42 32.42 0 0 1-9.244-23.497c.033-1.326.14-2.62.314-3.879Z" fill="url(#logo_svg__b)"></path>
+  <path d="M172.578 132.787a32.765 32.765 0 0 1 8.981 24.238c-1.458 28.748-36.622 41.778-56.46 20.92l-67.644-71.122a32.763 32.763 0 0 1-8.981-24.238c1.457-28.748 36.622-41.778 56.46-20.92l67.644 71.122Z" fill="url(#logo_svg__c)" fill-opacity="0.96"></path>
+  <defs>
+    <linearGradient id="logo_svg__a" x1="215.063" y1="59.628" x2="160.714" y2="157.96" gradientUnits="userSpaceOnUse">
+      <stop stop-color="#3EADFE"></stop>
+      <stop offset="1" stop-color="#2A7AFF"></stop>
+    </linearGradient>
+    <linearGradient id="logo_svg__b" x1="105.376" y1="84.416" x2="19.745" y2="131.163" gradientUnits="userSpaceOnUse">
+      <stop stop-color="#01B3FF"></stop>
+      <stop offset="1" stop-color="#59ECFA"></stop>
+    </linearGradient>
+    <linearGradient id="logo_svg__c" x1="102.734" y1="136.396" x2="192.577" y2="155.859" gradientUnits="userSpaceOnUse">
+      <stop stop-color="#023BFF" stop-opacity="0.82"></stop>
+      <stop offset="0.88" stop-color="#2D86FF" stop-opacity="0.76"></stop>
+    </linearGradient>
+  </defs>
 </svg>

+ 0 - 1
app/icons/www-delete.svg

@@ -1 +0,0 @@
-<svg class="icon--SJP_d" width="16" height="16" fill="none" viewBox="0 0 18 18" style="min-width: 16px; min-height: 16px;"><g><path data-follow-fill="currentColor" d="m10.052 8.996 3.221-3.214a.752.752 0 0 0-1.063-1.064L8.996 7.94 5.783 4.72a.752.752 0 1 0-1.064 1.063L7.94 8.996l-3.22 3.213a.75.75 0 0 0 0 1.064.75.75 0 0 0 1.063 0l3.213-3.221 3.214 3.22a.749.749 0 0 0 1.063 0 .75.75 0 0 0 0-1.063l-3.22-3.213Z" fill="currentColor"></path></g></svg>