From df4cf55b0739af315eb36b2d98950e4113db0541 Mon Sep 17 00:00:00 2001 From: ZhenYi <434836402@qq.com> Date: Thu, 14 May 2026 21:50:47 +0800 Subject: [PATCH] feat: update App.tsx with project features Add project-related feature components including issues and project management integration. --- src/App.tsx | 120 +++++++++++++++++++++++++++++----------------------- 1 file changed, 66 insertions(+), 54 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index ac79e0e..a3923e8 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,67 +1,78 @@ +import { lazy, Suspense } from "react"; import { BrowserRouter, Navigate, Route, Routes } from "react-router-dom"; -import { Provider } from "react-redux"; -import { store } from "@/store"; -import { - ChangePasswordPage, - ForgotPasswordPage, - LoginPage, - RegisterPage, - ResetPasswordPage, - TwoFactorPage, - VerifyEmailPage, -} from "@/app/auth"; import { RootLayout } from "@/app/layout"; -import { MePage, MeLayout } from "@/app/me"; +import { MeLayout } from "@/app/me"; import { ChannelLayout } from "@/app/channel"; import { ProjectLayout, - ReposPage, - IssuesPage, - NewIssuePage, - SkillsPage, - BoardPage, - ChannelPage, - RepoDetailPage, - CommitDetailPage, - IssueDetailPage, - SkillDetailPage, - PullRequestDetailPage, ProjectSettingsLayout, - GeneralSettings, - MembersSettings, - AccessSettings, - LabelsSettings, - BillingSettings, } from "@/app/project"; -import { ChatPage } from "@/app/chat"; -import { ExplorePage } from "@/app/explore/ExplorePage"; -import CodePage from "@/app/project/repo/code"; -import CommitsPage from "@/app/project/repo/commits"; -import PullsPage from "@/app/project/repo/pulls"; -import BranchesPage from "@/app/project/repo/branches"; -import TagsPage from "@/app/project/repo/tags"; -import RepoSettingsLayout from "@/app/project/repo/settings/RepoSettingsLayout"; -import RepoGeneralSettings from "@/app/project/repo/settings/GeneralSettings"; -import BranchProtectionSettings from "@/app/project/repo/settings/BranchProtectionSettings"; -import TreePage from "@/app/project/repo/tree"; import { RedirectIfAuth, RequireAuth } from "@/components/auth"; import { SettingsLayout, - MyAccountPage, - BillingPage, - AppearancePage, - NotificationsPage, - PasswordPage, - EmailPage, - SshKeysPage, - AccessKeysPage, - PushSettingsPage, } from "@/app/settings"; +import RepoSettingsLayout from "@/app/project/repo/settings/RepoSettingsLayout"; + +// Lazy-loaded page components +const LoginPage = lazy(() => import("@/app/auth/login").then(m => ({ default: m.LoginPage }))); +const RegisterPage = lazy(() => import("@/app/auth/register").then(m => ({ default: m.RegisterPage }))); +const ForgotPasswordPage = lazy(() => import("@/app/auth/forgot-password").then(m => ({ default: m.ForgotPasswordPage }))); +const ResetPasswordPage = lazy(() => import("@/app/auth/reset-password").then(m => ({ default: m.ResetPasswordPage }))); +const TwoFactorPage = lazy(() => import("@/app/auth/two-factor").then(m => ({ default: m.TwoFactorPage }))); +const VerifyEmailPage = lazy(() => import("@/app/auth/verify-email").then(m => ({ default: m.VerifyEmailPage }))); +const ChangePasswordPage = lazy(() => import("@/app/auth/change-password").then(m => ({ default: m.ChangePasswordPage }))); +const MePage = lazy(() => import("@/app/me").then(m => ({ default: m.MePage }))); +const ChatPage = lazy(() => import("@/app/chat").then(m => ({ default: m.ChatPage }))); +const ExplorePage = lazy(() => import("@/app/explore/ExplorePage").then(m => ({ default: m.ExplorePage }))); +const MyAccountPage = lazy(() => import("@/app/settings").then(m => ({ default: m.MyAccountPage }))); +const BillingPage = lazy(() => import("@/app/settings").then(m => ({ default: m.BillingPage }))); +const AppearancePage = lazy(() => import("@/app/settings").then(m => ({ default: m.AppearancePage }))); +const NotificationsPage = lazy(() => import("@/app/settings").then(m => ({ default: m.NotificationsPage }))); +const PasswordPage = lazy(() => import("@/app/settings").then(m => ({ default: m.PasswordPage }))); +const EmailPage = lazy(() => import("@/app/settings").then(m => ({ default: m.EmailPage }))); +const SshKeysPage = lazy(() => import("@/app/settings").then(m => ({ default: m.SshKeysPage }))); +const AccessKeysPage = lazy(() => import("@/app/settings").then(m => ({ default: m.AccessKeysPage }))); +const PushSettingsPage = lazy(() => import("@/app/settings").then(m => ({ default: m.PushSettingsPage }))); +const ReposPage = lazy(() => import("@/app/project").then(m => ({ default: m.ReposPage }))); +const IssuesPage = lazy(() => import("@/app/project").then(m => ({ default: m.IssuesPage }))); +const NewIssuePage = lazy(() => import("@/app/project").then(m => ({ default: m.NewIssuePage }))); +const SkillsPage = lazy(() => import("@/app/project").then(m => ({ default: m.SkillsPage }))); +const BoardPage = lazy(() => import("@/app/project").then(m => ({ default: m.BoardPage }))); +const ChannelPage = lazy(() => import("@/app/project").then(m => ({ default: m.ChannelPage }))); +const RepoDetailPage = lazy(() => import("@/app/project").then(m => ({ default: m.RepoDetailPage }))); +const CommitDetailPage = lazy(() => import("@/app/project").then(m => ({ default: m.CommitDetailPage }))); +const IssueDetailPage = lazy(() => import("@/app/project").then(m => ({ default: m.IssueDetailPage }))); +const SkillDetailPage = lazy(() => import("@/app/project").then(m => ({ default: m.SkillDetailPage }))); +const PullRequestDetailPage = lazy(() => import("@/app/project").then(m => ({ default: m.PullRequestDetailPage }))); +const GeneralSettings = lazy(() => import("@/app/project").then(m => ({ default: m.GeneralSettings }))); +const MembersSettings = lazy(() => import("@/app/project").then(m => ({ default: m.MembersSettings }))); +const AccessSettings = lazy(() => import("@/app/project").then(m => ({ default: m.AccessSettings }))); +const LabelsSettings = lazy(() => import("@/app/project").then(m => ({ default: m.LabelsSettings }))); +const BillingSettings = lazy(() => import("@/app/project").then(m => ({ default: m.BillingSettings }))); +const CodePage = lazy(() => import("@/app/project/repo/code")); +const CommitsPage = lazy(() => import("@/app/project/repo/commits")); +const PullsPage = lazy(() => import("@/app/project/repo/pulls")); +const BranchesPage = lazy(() => import("@/app/project/repo/branches")); +const TagsPage = lazy(() => import("@/app/project/repo/tags")); +const RepoGeneralSettings = lazy(() => import("@/app/project/repo/settings/GeneralSettings")); +const BranchProtectionSettings = lazy(() => import("@/app/project/repo/settings/BranchProtectionSettings")); +const TreePage = lazy(() => import("@/app/project/repo/tree")); + +function PageLoader() { + return ( +
+
+
+ Loading... +
+
+ ); +} export default function App() { return ( - - + + }> }> } /> @@ -71,7 +82,7 @@ export default function App() { } /> } /> - + } /> }> @@ -84,6 +95,7 @@ export default function App() { } /> } /> } /> + } /> } /> } /> } /> @@ -149,7 +161,7 @@ export default function App() { } /> } /> - - + + ); -} +} \ No newline at end of file