feat: update App routing and MeSidebar component

Add project routes to App, update MeSidebar with navigation
links to invitations and settings.
This commit is contained in:
ZhenYi 2026-05-14 23:15:54 +08:00
parent 31e9bb68ac
commit 3a1a7b97db
2 changed files with 15 additions and 2 deletions

View File

@ -22,6 +22,7 @@ const TwoFactorPage = lazy(() => import("@/app/auth/two-factor").then(m => ({ de
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 MyInvitationsPage = lazy(() => import("@/app/me/MyInvitationsPage"));
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 })));
@ -44,6 +45,8 @@ const CommitDetailPage = lazy(() => import("@/app/project").then(m => ({ default
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 ProjectJoinPage = lazy(() => import("@/app/project").then(m => ({ default: m.ProjectJoinPage })));
const ProjectInvitationPage = lazy(() => import("@/app/project").then(m => ({ default: m.ProjectInvitationPage })));
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 })));
@ -96,6 +99,7 @@ export default function App() {
<Route path="/me/followers" element={<MePage />} />
<Route path="/me/following" element={<MePage />} />
<Route path="/me/notify" element={<MePage />} />
<Route path="/me/invitations" element={<MyInvitationsPage />} />
<Route path="/me/chat" element={<ChatPage scope="personal" />} />
<Route path="/me/chat/:conversationId" element={<ChatPage scope="personal" />} />
<Route path="/explore" element={<ExplorePage />} />
@ -117,6 +121,9 @@ export default function App() {
{/* Channel-based routes if any */}
</Route>
<Route path="/projects/:projectName/invitations" element={<ProjectInvitationPage />} />
<Route path="/:projectName/join" element={<ProjectJoinPage />} />
<Route path="/:projectName" element={<ProjectLayout />}>
<Route index element={<Navigate to="repos" replace />} />
<Route path="repos" element={<ReposPage />} />
@ -164,4 +171,4 @@ export default function App() {
</Suspense>
</BrowserRouter>
);
}
}

View File

@ -8,6 +8,7 @@ import {
Users,
MessageSquare,
Bell,
Mail,
PanelLeftClose
} from "lucide-react";
import type { ComponentType } from "react";
@ -53,6 +54,11 @@ const ME_NAV_ITEMS: NavItem[] = [
name: "Notifications",
icon: Bell,
},
{
path: "/me/invitations",
name: "Invitations",
icon: Mail,
},
{
path: "/me/stars",
name: "Stars",
@ -206,4 +212,4 @@ export function MeSidebar({ onCollapse }: MeSidebarProps) {
</nav>
</div>
);
}
}