feat: update App.tsx with project features
Add project-related feature components including issues and project management integration.
This commit is contained in:
parent
826fa1226a
commit
df4cf55b07
120
src/App.tsx
120
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 (
|
||||
<div className="flex h-full items-center justify-center" style={{ backgroundColor: "var(--surface-ground)" }}>
|
||||
<div className="flex flex-col items-center gap-3">
|
||||
<div className="h-5 w-5 animate-spin rounded-full border-2" style={{ borderColor: "var(--border-strong)", borderTopColor: "var(--accent)" }} />
|
||||
<span className="text-xs" style={{ color: "var(--text-muted)" }}>Loading...</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
<Provider store={store}>
|
||||
<BrowserRouter>
|
||||
<BrowserRouter>
|
||||
<Suspense fallback={<PageLoader />}>
|
||||
<Routes>
|
||||
<Route element={<RedirectIfAuth />}>
|
||||
<Route path="/auth/login" element={<LoginPage />} />
|
||||
@ -71,7 +82,7 @@ export default function App() {
|
||||
<Route path="/auth/two-factor" element={<TwoFactorPage />} />
|
||||
<Route path="/auth/verify-email" element={<VerifyEmailPage />} />
|
||||
</Route>
|
||||
|
||||
|
||||
<Route path="/auth/change-password" element={<ChangePasswordPage />} />
|
||||
|
||||
<Route element={<RequireAuth />}>
|
||||
@ -84,6 +95,7 @@ export default function App() {
|
||||
<Route path="/me/stars" element={<MePage />} />
|
||||
<Route path="/me/followers" element={<MePage />} />
|
||||
<Route path="/me/following" element={<MePage />} />
|
||||
<Route path="/me/notify" element={<MePage />} />
|
||||
<Route path="/me/chat" element={<ChatPage scope="personal" />} />
|
||||
<Route path="/me/chat/:conversationId" element={<ChatPage scope="personal" />} />
|
||||
<Route path="/explore" element={<ExplorePage />} />
|
||||
@ -149,7 +161,7 @@ export default function App() {
|
||||
<Route path="/" element={<Navigate to="/me" replace />} />
|
||||
<Route path="*" element={<Navigate to="/me" replace />} />
|
||||
</Routes>
|
||||
</BrowserRouter>
|
||||
</Provider>
|
||||
</Suspense>
|
||||
</BrowserRouter>
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user