Skip to content

feat: build individual group detail page at /groups/[id] (Closes #9) - #53

Open
waterWang wants to merge 1 commit into
coopfinance:mainfrom
waterWang:feat/group-detail-page
Open

feat: build individual group detail page at /groups/[id] (Closes #9)#53
waterWang wants to merge 1 commit into
coopfinance:mainfrom
waterWang:feat/group-detail-page

Conversation

@waterWang

Copy link
Copy Markdown

Summary

Creates the missing /groups/[id] route that was previously returning a 404. The Groups list page has "View Group" links pointing to /groups/[id] — this PR implements the detail page those links navigate to.

Changes

New file: src/app/groups/[id]/page.tsx

Header:

  • Group name, description, status badge (Active/Inactive)
  • Admin address (shortened with copy-to-clipboard button)
  • Creation date and member count
  • "Add Member" button visible only to the group admin

Stats Row (4 cards):

  • Treasury balance (USDC on Stellar, with live Soroban RPC TODO)
  • Total members (with active count)
  • Active loans (with total count)
  • Total contributions (lifetime)

Four tabs using @radix-ui/react-tabs:

Tab Content
Members Table with display name, address, contributed amount, loan balance, join date, active status
Contributions Table with member, amount, period, date, tx hash (linked to Stellar Expert)
Loans Grid of existing LoanCard components filtered to this group
Governance Grid of existing ProposalCard components filtered to this group

States handled:

  • Loading state (skeleton animation)
  • 404 state (with "Browse Groups" link)
  • Empty state per tab
  • Pre-existing TypeScript errors are unchanged (layout.tsx Toaster import error)

Data fetching:

  • React Query for all data with configurable stale/refetch times
  • Mock data fallback with // TODO: connect to API comments
  • API endpoints: GET /api/groups/:id, /members, /contributions, /loans, /proposals

Responsive:

  • Mobile-first layout with Tailwind breakpoints
  • Horizontal scroll on tables for small viewports
  • Stacked layout on mobile, grid on desktop

Testing

  • npx tsc --noEmit passes (pre-existing error in layout.tsx only)
  • All existing tests pass

Closes #9

…finance#9)

- Header with group name, description, status badge, admin address with copy button
- Add Member button (admin only)
- Stats row: treasury balance, total members, active loans, total contributions
- Four tabs: Members, Contributions, Loans, Governance
- Reuses LoanCard and ProposalCard components
- Tx hashes link to Stellar Expert explorer
- 404 handling for missing groups
- Fully mobile responsive with mock data fallbacks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Frontend] Build individual group detail page at /groups/[id]

1 participant