refactor: relocate components to app directory structure

This commit is contained in:
2026-06-09 14:43:10 +08:00
parent f060301c24
commit cda55c8f9b
61 changed files with 19 additions and 27 deletions
@@ -4,7 +4,7 @@ import {
validateEmail,
validatePassword,
validateUsername,
} from "@/components/auth/auth-validators";
} from "@/app/auth/components/auth-validators";
describe("validateEmail", () => {
it("accepts a valid email", () => {
@@ -4,7 +4,7 @@
*
* 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 { AuthDivider } from "./auth-divider";
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 { useAuthGate } from "@/lib/auth/use-auth-gate";
import { ROUTES } from "@/lib/routes";
import { MobileShell } from "@/components/core/mobile-shell";
import { AuthPanel } from "@/components/auth/auth-panel";
import { MobileShell } from "@/app/_components/core/mobile-shell";
import { AuthPanel } from "@/app/auth/components/auth-panel";
export interface AuthScreenProps {
/** 自定义背景(默认紫粉渐变)。 */
@@ -10,7 +10,7 @@ import { useAuthDispatch } from "@/contexts/auth/auth-context";
import {
validateEmail,
validatePassword,
} from "@/components/auth/auth-validators";
} from "@/app/auth/components/auth-validators";
import { AuthTextField } from "./auth-text-field";
import { AuthPrimaryButton } from "./auth-primary-button";
@@ -12,7 +12,7 @@ import {
validateEmail,
validatePassword,
validateUsername,
} from "@/components/auth/auth-validators";
} from "@/app/auth/components/auth-validators";
import { AuthTextField } from "./auth-text-field";
import { AuthPrimaryButton } from "./auth-primary-button";
+1 -1
View File
@@ -1,6 +1,6 @@
"use client";
import { AuthScreen } from "@/components/auth/auth-screen";
import { AuthScreen } from "@/app/auth/components/auth-screen";
export default function AuthPage() {
return <AuthScreen />;
@@ -2,8 +2,8 @@
import { type FormEvent, useEffect, useRef, useState } from "react";
import { MobileShell } from "@/components/core/mobile-shell";
import { Dialog } from "@/components/core/dialog";
import { MobileShell } from "@/app/_components/core/mobile-shell";
import { Dialog } from "@/app/_components/core/dialog";
import { useChatDispatch, useChatState } from "@/contexts/chat/chat-context";
import { GuestChatQuota } from "@/contexts/chat/chat-types";
import type { UiMessage } from "@/models/chat/ui-message";
+1 -1
View File
@@ -1,6 +1,6 @@
"use client";
import { ChatScreen } from "@/components/chat/chat-screen";
import { ChatScreen } from "@/app/chat/components/chat-screen";
export default function ChatPage() {
return <ChatScreen />;
@@ -3,7 +3,7 @@
import { useEffect } from "react";
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 styles from "./sidebar-screen.module.css";
+1 -1
View File
@@ -1,6 +1,6 @@
"use client";
import { SidebarScreen } from "@/components/sidebar/sidebar-screen";
import { SidebarScreen } from "@/app/sidebar/components/sidebar-screen";
export default function SidebarPage() {
return <SidebarScreen />;
@@ -6,9 +6,9 @@
*/
import { useAuthState } from "@/contexts/auth/auth-context";
import { AuthSocialButtons } from "@/components/auth/auth-social-buttons";
import { AuthPrimaryButton } from "@/components/auth/auth-primary-button";
import { AuthDivider } from "@/components/auth/auth-divider";
import { AuthSocialButtons } from "@/app/auth/components/auth-social-buttons";
import { AuthPrimaryButton } from "@/app/auth/components/auth-primary-button";
import { AuthDivider } from "@/app/auth/components/auth-divider";
import { useAuthDispatch } from "@/contexts/auth/auth-context";
import styles from "./splash-button.module.css";
@@ -6,7 +6,7 @@
*
* `<LoadingIndicator>`splash auth
*/
import { LoadingIndicator } from "@/components/core/loading-indicator";
import { LoadingIndicator } from "@/app/_components/core/loading-indicator";
export function SplashLoading() {
return <LoadingIndicator size={48} color="var(--color-accent)" />;
@@ -1,13 +1,5 @@
"use client";
/**
* Splash
*
* Dart: lib/ui/splash/splash_screen.dart
*
*
* - + + + Skip/Facebook +
* - /chat
*/
import { useRouter } from "next/navigation";
import { useEffect, useRef } from "react";
@@ -16,7 +8,7 @@ import { useChatDispatch } from "@/contexts/chat/chat-context";
import { useUserDispatch } from "@/contexts/user/user-context";
import { useAuthGate } from "@/lib/auth/use-auth-gate";
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 { SplashLogo } from "./splash-logo";
+1 -1
View File
@@ -1,6 +1,6 @@
"use client";
import { SplashScreen } from "@/components/splash/splash-screen";
import { SplashScreen } from "@/app/splash/components/splash-screen";
export default function SplashPage() {
return <SplashScreen />;