diff --git a/src/app/auth/auth-screen.tsx b/src/app/auth/auth-screen.tsx index e83bb5f5..e5d449ed 100644 --- a/src/app/auth/auth-screen.tsx +++ b/src/app/auth/auth-screen.tsx @@ -13,7 +13,6 @@ import { ROUTES } from "@/router/routes"; import { useAppNavigator } from "@/router/use-app-navigator"; import { AuthBackground, AuthPanel } from "./components"; -import styles from "./components/auth-screen.module.css"; import { Logger } from "@/utils"; const log = new Logger("AppAuthAuthScreen"); @@ -51,9 +50,15 @@ export function AuthScreen() { return ( -
+
-
+
diff --git a/src/app/auth/components/__tests__/tailwind-components.test.tsx b/src/app/auth/components/__tests__/tailwind-components.test.tsx index 91fede1a..5e6e7cf8 100644 --- a/src/app/auth/components/__tests__/tailwind-components.test.tsx +++ b/src/app/auth/components/__tests__/tailwind-components.test.tsx @@ -1,7 +1,14 @@ import { renderToStaticMarkup } from "react-dom/server"; -import { describe, expect, it } from "vitest"; +import { describe, expect, it, vi } from "vitest"; +import { AuthBackground } from "../auth-background"; import { AuthErrorMessage } from "../auth-error-message"; +import { EmailLoginForm } from "../email-login-form"; +import { EmailRegisterForm } from "../email-register-form"; + +vi.mock("@/stores/auth/auth-context", () => ({ + useAuthDispatch: () => vi.fn(), +})); describe("auth Tailwind components", () => { it("renders AuthErrorMessage only when a message is present", () => { @@ -12,4 +19,34 @@ describe("auth Tailwind components", () => { expect(html).toContain("text-error"); expect(html).toContain("Invalid email"); }); + + it("renders EmailLoginForm with Tailwind form layout", () => { + const html = renderToStaticMarkup(); + + expect(html).toContain(" { + const html = renderToStaticMarkup(); + + expect(html).toContain(" { + const html = renderToStaticMarkup(); + + expect(html).toContain("absolute"); + expect(html).toContain("inset-0"); + expect(html).toContain("bg-[#fbf1f2]"); + expect(html).toContain("object-cover"); + expect(html).toContain("%2Fimages%2Fauth%2Fbg-login.png"); + }); }); diff --git a/src/app/auth/components/auth-background.module.css b/src/app/auth/components/auth-background.module.css deleted file mode 100644 index 7ab89f18..00000000 --- a/src/app/auth/components/auth-background.module.css +++ /dev/null @@ -1,14 +0,0 @@ -/* Auth 背景图片容器(与 splash-background.module.css 同款) */ - -.bg { - position: absolute; - inset: 0; - z-index: 0; - background: #fbf1f2; - overflow: hidden; -} - -.image { - object-fit: cover; - object-position: center; -} diff --git a/src/app/auth/components/auth-background.tsx b/src/app/auth/components/auth-background.tsx index be8a346b..108adfba 100644 --- a/src/app/auth/components/auth-background.tsx +++ b/src/app/auth/components/auth-background.tsx @@ -5,18 +5,17 @@ * 资源: /public/images/auth/bg-login.png */ import Image from "next/image"; -import styles from "./auth-background.module.css"; export function AuthBackground() { return ( -
+
); diff --git a/src/app/auth/components/auth-panel.module.css b/src/app/auth/components/auth-panel.module.css deleted file mode 100644 index 51303282..00000000 --- a/src/app/auth/components/auth-panel.module.css +++ /dev/null @@ -1,13 +0,0 @@ -/* - * - * 视觉规格(与 Dart 对齐): - * - panelShell 包裹整个面板(position: relative) - */ -.panelShell { - position: relative; - flex: 1 1 auto; - display: flex; - flex-direction: column; - width: 100%; - min-height: 0; -} diff --git a/src/app/auth/components/auth-panel.tsx b/src/app/auth/components/auth-panel.tsx index c8e3f1e0..39aab185 100644 --- a/src/app/auth/components/auth-panel.tsx +++ b/src/app/auth/components/auth-panel.tsx @@ -8,7 +8,6 @@ import { useAuthDispatch, useAuthState } from "@/stores/auth/auth-context"; import { AuthEmailPanel } from "./auth-email-panel"; import { AuthFacebookPanel } from "./auth-facebook-panel"; -import styles from "./auth-panel.module.css"; export function AuthPanel() { const state = useAuthState(); @@ -29,7 +28,7 @@ export function AuthPanel() { }; return ( -
+
{state.authPanelMode === "facebook" ? ( diff --git a/src/app/auth/components/auth-screen.module.css b/src/app/auth/components/auth-screen.module.css deleted file mode 100644 index 615faa19..00000000 --- a/src/app/auth/components/auth-screen.module.css +++ /dev/null @@ -1,29 +0,0 @@ -/* auth-screen.module.css - * 与 splash-screen.module.css 同款结构(MobileShell 顶层 + .wrapper + .content) - * 移动端宽度约束由 ResponsiveMobileShell / MobileShell 统一提供。 - */ - -.wrapper { - position: relative; - flex: 1; - display: flex; - flex-direction: column; - width: 100%; - min-height: var(--app-viewport-height, 100dvh); - background: #fbf1f2; - overflow: hidden; -} - -.content { - position: relative; - z-index: 2; - display: flex; - flex: 1 1 auto; - flex-direction: column; - justify-content: center; - padding: - calc(var(--page-padding-y, var(--spacing-lg)) + var(--app-safe-top, 0px)) - calc(var(--page-padding-x, var(--spacing-lg)) + var(--app-safe-right, 0px)) - calc(var(--page-padding-y, var(--spacing-lg)) + var(--app-safe-bottom, 0px)) - calc(var(--page-padding-x, var(--spacing-lg)) + var(--app-safe-left, 0px)); -} diff --git a/src/app/auth/components/email-form.module.css b/src/app/auth/components/email-form.module.css deleted file mode 100644 index 4b9a45ca..00000000 --- a/src/app/auth/components/email-form.module.css +++ /dev/null @@ -1,14 +0,0 @@ -/* 邮箱登录/注册表单样式 - * - * - * - * 视觉规格(与 Dart 对齐): - * - 字段间距 12px(Dart AppSpacing.md) - * - 错误横幅与主按钮之间 12px - */ -.form { - display: flex; - flex-direction: column; - gap: var(--spacing-md); - width: 100%; -} diff --git a/src/app/auth/components/email-login-form.tsx b/src/app/auth/components/email-login-form.tsx index 8b0975c9..51bf1187 100644 --- a/src/app/auth/components/email-login-form.tsx +++ b/src/app/auth/components/email-login-form.tsx @@ -13,7 +13,6 @@ import { import { AuthTextField } from "./auth-text-field"; import { AuthPrimaryButton } from "./auth-primary-button"; import { AuthErrorMessage } from "./auth-error-message"; -import styles from "./email-form.module.css"; import { AppEnvUtil, Logger } from "@/utils"; const log = new Logger("AppAuthComponentsEmailLoginForm"); @@ -76,7 +75,7 @@ export function EmailLoginForm({ return (
{ e.preventDefault(); submit(); diff --git a/src/app/auth/components/email-register-form.tsx b/src/app/auth/components/email-register-form.tsx index 9a9366c3..148f3da0 100644 --- a/src/app/auth/components/email-register-form.tsx +++ b/src/app/auth/components/email-register-form.tsx @@ -24,7 +24,6 @@ import { import { AuthTextField } from "./auth-text-field"; import { AuthPrimaryButton } from "./auth-primary-button"; import { AuthErrorMessage } from "./auth-error-message"; -import styles from "./email-form.module.css"; import { Logger } from "@/utils"; const log = new Logger("AppAuthComponentsEmailRegisterForm"); @@ -112,7 +111,7 @@ export function EmailRegisterForm({ return ( { e.preventDefault(); submit(); diff --git a/src/app/auth/components/google-sign-in-button.module.css b/src/app/auth/components/google-sign-in-button.module.css deleted file mode 100644 index bf971629..00000000 --- a/src/app/auth/components/google-sign-in-button.module.css +++ /dev/null @@ -1,7 +0,0 @@ -.slot { - display: flex; - align-items: center; - justify-content: center; - width: 100%; - min-height: var(--button-height); -}