diff --git a/src/app/auth/components/auth-email-panel.tsx b/src/app/auth/components/auth-email-panel.tsx index 7f9af2ae..f31548c6 100644 --- a/src/app/auth/components/auth-email-panel.tsx +++ b/src/app/auth/components/auth-email-panel.tsx @@ -13,6 +13,7 @@ * - Spacer + AuthLegalText * - 顶部 "← Back" 按钮由父级 AuthPanel 渲染(悬浮 40×40 圆形) */ +import Image from "next/image"; import { useState } from "react"; import { useAuthState } from "@/stores/auth/auth-context"; @@ -48,10 +49,13 @@ export function AuthEmailPanel({ {mode === "login" ? ( <>
-
>
) : (
diff --git a/src/app/auth/components/auth-facebook-panel.tsx b/src/app/auth/components/auth-facebook-panel.tsx
index 9d63528a..a5199df8 100644
--- a/src/app/auth/components/auth-facebook-panel.tsx
+++ b/src/app/auth/components/auth-facebook-panel.tsx
@@ -11,6 +11,7 @@
* - "Other Sign-in Options" 链接打开底部弹层
* - 弹层 Email 按钮 → 触发 `onSwitchToEmail`(父级派发 `AuthPanelModeChanged`)
*/
+import Image from "next/image";
import { useState } from "react";
import { AuthPlatform } from "@/lib/auth/nextauth";
@@ -56,10 +57,13 @@ export function AuthFacebookPanel({ onSwitchToEmail }: AuthFacebookPanelProps) {
return (
diff --git a/src/app/chat/components/browser-hint-overlay.tsx b/src/app/chat/components/browser-hint-overlay.tsx
index 28d7b9b6..c84b046d 100644
--- a/src/app/chat/components/browser-hint-overlay.tsx
+++ b/src/app/chat/components/browser-hint-overlay.tsx
@@ -12,7 +12,7 @@
* - 生产环境仅在应用内浏览器中显示
* - 视觉:右上角 👆 + 模糊背景气泡
*/
-import { useEffect, useState } from "react";
+import { useState } from "react";
import styles from "./browser-hint-overlay.module.css";
@@ -36,11 +36,8 @@ export function BrowserHintOverlay({
text = DEFAULT_TEXT,
forceShow = false,
}: BrowserHintOverlayProps) {
- const [isInAppBrowser, setIsInAppBrowser] = useState(false);
-
- useEffect(() => {
- setIsInAppBrowser(detectInAppBrowser());
- }, []);
+ // lazy initializer:首次渲染即计算(避免 useEffect 中调 setState 的 lint 错)
+ const [isInAppBrowser] = useState(detectInAppBrowser);
// 开发模式或应用内浏览器才显示
const shouldShow = forceShow || isInAppBrowser;
diff --git a/src/app/chat/components/chat-area.tsx b/src/app/chat/components/chat-area.tsx
index 530d1e21..adc37372 100644
--- a/src/app/chat/components/chat-area.tsx
+++ b/src/app/chat/components/chat-area.tsx
@@ -75,11 +75,11 @@ function renderMessagesWithDateHeaders(messages: readonly UiMessage[]) {