Skip to content

feat: BountyCountdown timer component (closes #826)#1031

Open
tarai-dl wants to merge 1 commit intoSolFoundry:mainfrom
tarai-dl:rn/bounty-countdown-timer
Open

feat: BountyCountdown timer component (closes #826)#1031
tarai-dl wants to merge 1 commit intoSolFoundry:mainfrom
tarai-dl:rn/bounty-countdown-timer

Conversation

@tarai-dl
Copy link
Copy Markdown

Summary

Implements a real-time countdown timer component for bounty deadlines.

Features

  • Real-time updates: Counts down every second using useCountdown hook
  • Two variants: compact (pill badge for cards) and full (segmented display for detail page)
  • Visual urgency indicators:
    • 🟢 Green: > 24 hours remaining
    • 🟡 Amber + "Ending soon": < 24 hours
    • 🔴 Red + pulse animation + "Urgent!": < 1 hour
    • ⬜ Muted "Expired": deadline passed
  • Responsive: Adapts layout for small screens

Files Added/Modified

File Action
frontend/src/hooks/useCountdown.ts New — countdown logic hook
frontend/src/components/bounty/BountyCountdown.tsx New — timer component
frontend/src/components/bounty/BountyCard.tsx Modified — integrated compact timer
frontend/src/components/bounty/BountyDetail.tsx Modified — integrated full timer
frontend/src/lib/utils.ts New — shared utilities
frontend/src/lib/animations.ts New — framer-motion variants
frontend/src/__tests__/bounty-countdown.test.tsx New — 7 passing tests

Test Results

All 7 tests pass ✓

Closes #826

- Add useCountdown hook with real-time per-second updates
- Add BountyCountdown component with compact and full variants
  - Compact: single-line pill for bounty cards
  - Full: segmented days/hours/minutes/seconds for detail page
- Color transitions: green → amber (<24h) → red (<1h) → expired
- Responsive: adapts to small screens
- Integrate into BountyCard and BountyDetail
- Add comprehensive test suite (7 tests, all passing)
- Add missing lib/utils.ts and lib/animations.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

missing-wallet PR is missing a Solana wallet for bounty payout

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🏭 Bounty T1: Bounty Countdown Timer Component

1 participant