Skip to content

Implement Nested Route Structure for Dashboard Module #177

@Olowodarey

Description

@Olowodarey

The dashboard module currently renders all content within a single flat page.tsx at /dashboard. While a layout.tsx exists with a Sidebar and TopNav, the sidebar navigation links (/dashboard/savings-pools, /dashboard/staking, /dashboard/analytics, /dashboard/governance, /dashboard/settings) point to routes that do not have corresponding page files, resulting in 404s when navigated to.

The dashboard needs to be restructured to follow the Next.js App Router nested layout & routing pattern, where each sidebar link maps to its own route segment rendered dynamically within the shared dashboard layout.

Current State

app/dashboard/
├── dashboard.css
├── layout.tsx       ← exists, renders Sidebar + TopNav + {children}
└── page.tsx         ← single monolithic page, all dashboard content lives here
  • The Sidebar component defines navigation links to 5 sub-routes, but none of these routes exist as folders/pages.
  • Navigating to any sub-route (e.g., /dashboard/savings-pools) results in a 404.
  • All dashboard widgets (NetWorthCard, QuickActionsGrid, ActivePoolList) are hardcoded inside the single page.tsx.

Expected State

app/dashboard/
├── layout.tsx              ← shared layout (Sidebar + TopNav) — already exists
├── page.tsx                ← overview/home content for /dashboard
├── savings-pools/
│   └── page.tsx            ← content for /dashboard/savings-pools
├── staking/
│   └── page.tsx            ← content for /dashboard/staking
├── analytics/
│   └── page.tsx            ← content for /dashboard/analytics
├── governance/
│   └── page.tsx            ← content for /dashboard/governance
└── settings/
    └── page.tsx            ← content for /dashboard/settings

Implementation Steps

  1. Create route folders for each sidebar link under app/dashboard/:

    • savings-pools/page.tsx
    • staking/page.tsx
    • analytics/page.tsx
    • governance/page.tsx
    • settings/page.tsx
  2. Add a placeholder page component in each new route file. Each should export a default React component with a descriptive heading (e.g., "Savings Pools") so the route is navigable and renders within the existing dashboard layout.

  3. Keep app/dashboard/page.tsx as the overview/home view (/dashboard). No changes needed here — it already renders the main dashboard widgets.

  4. Verify the existing layout.tsx correctly wraps all child routes. The current implementation already renders {children}, so it should work out of the box.

  5. Test navigation: Clicking each sidebar link should render the corresponding sub-page inside the dashboard layout (Sidebar + TopNav persist, content area updates).

Acceptance Criteria

  • All 5 sidebar routes resolve to their own pages instead of returning 404.
  • Each sub-route renders within the shared dashboard layout (Sidebar and TopNav remain visible).
  • The /dashboard route still renders the current overview widgets.
  • Active sidebar link highlighting works correctly on each sub-route.
  • No broken imports or console errors.

Metadata

Metadata

Assignees

Labels

RefactorThis will not be worked onStellar WaveIssues in the Stellar wave programbugSomething isn't workingenhancementNew feature or requestfrontendhardhelp wantedExtra attention is needed

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions