refactor: relocate components to app directory structure
This commit is contained in:
+1
-1
@@ -4,7 +4,7 @@ import {
|
|||||||
validateEmail,
|
validateEmail,
|
||||||
validatePassword,
|
validatePassword,
|
||||||
validateUsername,
|
validateUsername,
|
||||||
} from "@/components/auth/auth-validators";
|
} from "@/app/auth/components/auth-validators";
|
||||||
|
|
||||||
describe("validateEmail", () => {
|
describe("validateEmail", () => {
|
||||||
it("accepts a valid email", () => {
|
it("accepts a valid email", () => {
|
||||||
+1
-1
@@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* 原始 Dart: lib/ui/auth/widgets/auth_other_options_dialog.dart
|
* 原始 Dart: lib/ui/auth/widgets/auth_other_options_dialog.dart
|
||||||
*/
|
*/
|
||||||
import { Dialog } from "@/components/core/dialog";
|
import { Dialog } from "@/app/_components/core/dialog";
|
||||||
import { AuthSocialButtons } from "./auth-social-buttons";
|
import { AuthSocialButtons } from "./auth-social-buttons";
|
||||||
import { AuthDivider } from "./auth-divider";
|
import { AuthDivider } from "./auth-divider";
|
||||||
import styles from "./auth-other-options-dialog.module.css";
|
import styles from "./auth-other-options-dialog.module.css";
|
||||||
@@ -18,8 +18,8 @@ import { useChatDispatch } from "@/contexts/chat/chat-context";
|
|||||||
import { useUserDispatch } from "@/contexts/user/user-context";
|
import { useUserDispatch } from "@/contexts/user/user-context";
|
||||||
import { useAuthGate } from "@/lib/auth/use-auth-gate";
|
import { useAuthGate } from "@/lib/auth/use-auth-gate";
|
||||||
import { ROUTES } from "@/lib/routes";
|
import { ROUTES } from "@/lib/routes";
|
||||||
import { MobileShell } from "@/components/core/mobile-shell";
|
import { MobileShell } from "@/app/_components/core/mobile-shell";
|
||||||
import { AuthPanel } from "@/components/auth/auth-panel";
|
import { AuthPanel } from "@/app/auth/components/auth-panel";
|
||||||
|
|
||||||
export interface AuthScreenProps {
|
export interface AuthScreenProps {
|
||||||
/** 自定义背景(默认紫粉渐变)。 */
|
/** 自定义背景(默认紫粉渐变)。 */
|
||||||
+1
-1
@@ -10,7 +10,7 @@ import { useAuthDispatch } from "@/contexts/auth/auth-context";
|
|||||||
import {
|
import {
|
||||||
validateEmail,
|
validateEmail,
|
||||||
validatePassword,
|
validatePassword,
|
||||||
} from "@/components/auth/auth-validators";
|
} from "@/app/auth/components/auth-validators";
|
||||||
|
|
||||||
import { AuthTextField } from "./auth-text-field";
|
import { AuthTextField } from "./auth-text-field";
|
||||||
import { AuthPrimaryButton } from "./auth-primary-button";
|
import { AuthPrimaryButton } from "./auth-primary-button";
|
||||||
+1
-1
@@ -12,7 +12,7 @@ import {
|
|||||||
validateEmail,
|
validateEmail,
|
||||||
validatePassword,
|
validatePassword,
|
||||||
validateUsername,
|
validateUsername,
|
||||||
} from "@/components/auth/auth-validators";
|
} from "@/app/auth/components/auth-validators";
|
||||||
|
|
||||||
import { AuthTextField } from "./auth-text-field";
|
import { AuthTextField } from "./auth-text-field";
|
||||||
import { AuthPrimaryButton } from "./auth-primary-button";
|
import { AuthPrimaryButton } from "./auth-primary-button";
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { AuthScreen } from "@/components/auth/auth-screen";
|
import { AuthScreen } from "@/app/auth/components/auth-screen";
|
||||||
|
|
||||||
export default function AuthPage() {
|
export default function AuthPage() {
|
||||||
return <AuthScreen />;
|
return <AuthScreen />;
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
import { type FormEvent, useEffect, useRef, useState } from "react";
|
import { type FormEvent, useEffect, useRef, useState } from "react";
|
||||||
|
|
||||||
import { MobileShell } from "@/components/core/mobile-shell";
|
import { MobileShell } from "@/app/_components/core/mobile-shell";
|
||||||
import { Dialog } from "@/components/core/dialog";
|
import { Dialog } from "@/app/_components/core/dialog";
|
||||||
import { useChatDispatch, useChatState } from "@/contexts/chat/chat-context";
|
import { useChatDispatch, useChatState } from "@/contexts/chat/chat-context";
|
||||||
import { GuestChatQuota } from "@/contexts/chat/chat-types";
|
import { GuestChatQuota } from "@/contexts/chat/chat-types";
|
||||||
import type { UiMessage } from "@/models/chat/ui-message";
|
import type { UiMessage } from "@/models/chat/ui-message";
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { ChatScreen } from "@/components/chat/chat-screen";
|
import { ChatScreen } from "@/app/chat/components/chat-screen";
|
||||||
|
|
||||||
export default function ChatPage() {
|
export default function ChatPage() {
|
||||||
return <ChatScreen />;
|
return <ChatScreen />;
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
|
||||||
import { MobileShell } from "@/components/core/mobile-shell";
|
import { MobileShell } from "@/app/_components/core/mobile-shell";
|
||||||
import { useUserDispatch, useUserState } from "@/contexts/user/user-context";
|
import { useUserDispatch, useUserState } from "@/contexts/user/user-context";
|
||||||
|
|
||||||
import styles from "./sidebar-screen.module.css";
|
import styles from "./sidebar-screen.module.css";
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { SidebarScreen } from "@/components/sidebar/sidebar-screen";
|
import { SidebarScreen } from "@/app/sidebar/components/sidebar-screen";
|
||||||
|
|
||||||
export default function SidebarPage() {
|
export default function SidebarPage() {
|
||||||
return <SidebarScreen />;
|
return <SidebarScreen />;
|
||||||
|
|||||||
+3
-3
@@ -6,9 +6,9 @@
|
|||||||
*/
|
*/
|
||||||
import { useAuthState } from "@/contexts/auth/auth-context";
|
import { useAuthState } from "@/contexts/auth/auth-context";
|
||||||
|
|
||||||
import { AuthSocialButtons } from "@/components/auth/auth-social-buttons";
|
import { AuthSocialButtons } from "@/app/auth/components/auth-social-buttons";
|
||||||
import { AuthPrimaryButton } from "@/components/auth/auth-primary-button";
|
import { AuthPrimaryButton } from "@/app/auth/components/auth-primary-button";
|
||||||
import { AuthDivider } from "@/components/auth/auth-divider";
|
import { AuthDivider } from "@/app/auth/components/auth-divider";
|
||||||
import { useAuthDispatch } from "@/contexts/auth/auth-context";
|
import { useAuthDispatch } from "@/contexts/auth/auth-context";
|
||||||
import styles from "./splash-button.module.css";
|
import styles from "./splash-button.module.css";
|
||||||
|
|
||||||
+1
-1
@@ -6,7 +6,7 @@
|
|||||||
*
|
*
|
||||||
* 包装 `<LoadingIndicator>`,splash 阶段可能用于等待 auth 检查。
|
* 包装 `<LoadingIndicator>`,splash 阶段可能用于等待 auth 检查。
|
||||||
*/
|
*/
|
||||||
import { LoadingIndicator } from "@/components/core/loading-indicator";
|
import { LoadingIndicator } from "@/app/_components/core/loading-indicator";
|
||||||
|
|
||||||
export function SplashLoading() {
|
export function SplashLoading() {
|
||||||
return <LoadingIndicator size={48} color="var(--color-accent)" />;
|
return <LoadingIndicator size={48} color="var(--color-accent)" />;
|
||||||
+2
-10
@@ -1,13 +1,5 @@
|
|||||||
"use client";
|
"use client";
|
||||||
/**
|
|
||||||
* Splash 屏幕
|
|
||||||
*
|
|
||||||
* 原始 Dart: lib/ui/splash/splash_screen.dart
|
|
||||||
*
|
|
||||||
* 行为:
|
|
||||||
* - 渐变背景 + 品牌区 + 内容文案 + Skip/Facebook 按钮 + 底部辅助信息
|
|
||||||
* - 已登录用户:自动跳 /chat(由父级处理)
|
|
||||||
*/
|
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useEffect, useRef } from "react";
|
import { useEffect, useRef } from "react";
|
||||||
|
|
||||||
@@ -16,7 +8,7 @@ import { useChatDispatch } from "@/contexts/chat/chat-context";
|
|||||||
import { useUserDispatch } from "@/contexts/user/user-context";
|
import { useUserDispatch } from "@/contexts/user/user-context";
|
||||||
import { useAuthGate } from "@/lib/auth/use-auth-gate";
|
import { useAuthGate } from "@/lib/auth/use-auth-gate";
|
||||||
import { ROUTES } from "@/lib/routes";
|
import { ROUTES } from "@/lib/routes";
|
||||||
import { MobileShell } from "@/components/core/mobile-shell";
|
import { MobileShell } from "@/app/_components/core/mobile-shell";
|
||||||
|
|
||||||
import { SplashBackground } from "./splash-background";
|
import { SplashBackground } from "./splash-background";
|
||||||
import { SplashLogo } from "./splash-logo";
|
import { SplashLogo } from "./splash-logo";
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { SplashScreen } from "@/components/splash/splash-screen";
|
import { SplashScreen } from "@/app/splash/components/splash-screen";
|
||||||
|
|
||||||
export default function SplashPage() {
|
export default function SplashPage() {
|
||||||
return <SplashScreen />;
|
return <SplashScreen />;
|
||||||
|
|||||||
Reference in New Issue
Block a user