diff --git a/frontend/src/pages/Home.tsx b/frontend/src/pages/Home.tsx index 92d3dc7..6ceb6c9 100644 --- a/frontend/src/pages/Home.tsx +++ b/frontend/src/pages/Home.tsx @@ -18,6 +18,7 @@ import { getRandomCharacter, encrypt } from '../lib/utlis.ts'; // feat: 导入密码模态框和相关 hook import { usePasswordModal } from '../components/password.tsx'; import PasswordIcon from '../components/icons/Password.tsx'; +import Close from '../components/icons/Close.tsx'; // 导入关闭图标 // 图标导入 import ShieldCheck from "../components/icons/ShieldCheck.tsx"; @@ -65,30 +66,49 @@ export function Home() { const showPasswordToast = useCallback((password: string) => { toast( (toastInstance) => ( -
-
-
- -
-
-

- {t('Save your password and continue using this email in 1 day')} -

-
- {password} - + // 优化:为弹窗添加独立的标题栏和关闭按钮,并调整整体样式 +
+ {/* 标题栏:包含图标、标题和关闭按钮 */} +
+
+ +

{t('View password')}

-

- {t("Remember your password, otherwise your email will expire and cannot be retrieved")} -

-
+
-
+ + {/* 内容区域 */} +
+

+ {t('Save your password and continue using this email in 1 day')} +

+
+ {password} + +
+

+ {t("Remember your password, otherwise your email will expire and cannot be retrieved")} +

+
+
), { id: 'password-notification', // 防止重复通知 duration: 5000, // 5秒后自动关闭 position: 'top-center', + // 优化:移除默认样式,让自定义组件完全控制外观 + style: { + background: 'transparent', + border: 'none', + padding: 0, + boxShadow: 'none', + }, } ); }, [t]);