Skip to content

[V2 200pts] Build personal currency watchlist — pin favourite pairs to dashboard with live rate updates #349

Description

@portableDD

Summary

Allow users to pin their favourite currency pairs to a personal watchlist on the dashboard. Instead of seeing all available rates, users see only the pairs they care about most — NGN/USD, NGN/GBP, etc. — with live rate updates.

What Needs to Be Done

1. Watchlist persistence

Store the user's watchlist in localStorage (no backend required for this feature):

// lib/utils/watchlist.ts
export const getWatchlist = (): string[] => ...       // returns ['NGN/USD', 'NGN/EUR']
export const addToWatchlist = (pair: string): void => ...
export const removeFromWatchlist = (pair: string): void => ...
export const isInWatchlist = (pair: string): boolean => ...

2. components/dashboard/watchlist.tsx

  • List of pinned currency pairs, each showing:
    • Pair label: "NGN / USD"
    • Current rate: "1 USD = 1,721.45 NGN"
    • 24h change: "+0.23%" in green or "-0.15%" in red (if backend provides historical rates)
    • Remove pin button (×)
  • "Add pair" button → dropdown of available pairs to add
  • Empty state: "No pairs saved. Add a currency pair to your watchlist."
  • Auto-refresh every 60 seconds (reuse exchange rate fetching from issue Skeletal Layout Loader for Term of Services #25)

3. Add/remove from market overview

On each rate card in components/dashboard/market-overview.tsx:

  • Star/pin icon button
  • Filled star = in watchlist, outline star = not in watchlist
  • Clicking toggles the pair in/out of the watchlist

4. Position on dashboard

  • Watchlist section appears at the top of the dashboard (above account overview) if the user has at least one pinned pair
  • Hidden entirely if the watchlist is empty

Acceptance Criteria

  • Pinning a pair from market overview adds it to the watchlist
  • Watchlist persists across page refresh (localStorage)
  • Watchlist hidden when empty
  • Auto-refresh every 60 seconds
  • Remove button removes the pair immediately
  • "Add pair" dropdown shows available pairs not already in watchlist
  • npm run build and npm run lint pass

⚠️ IMPORTANT — READ BEFORE SUBMITTING YOUR PR
Your pull request MUST target the v2 branch.
PRs targeting main or any other branch will not be reviewed and will not be merged.

Base branch: v2   ✅
Base branch: main ❌  → will be closed without review

Complexity: High — 200 points

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions