diff --git a/frontend/src/components/home/ActivityFeed.tsx b/frontend/src/components/home/ActivityFeed.tsx index 8b6b4b904..03b457be2 100644 --- a/frontend/src/components/home/ActivityFeed.tsx +++ b/frontend/src/components/home/ActivityFeed.tsx @@ -1,112 +1,93 @@ import React, { useState, useEffect } from 'react'; -import { motion, AnimatePresence } from 'framer-motion'; -import { slideInRight } from '../../lib/animations'; -import { timeAgo } from '../../lib/utils'; +import { motion } from 'framer-motion'; +import { GitPullRequest, DollarSign, Star, Zap } from 'lucide-react'; interface ActivityEvent { id: string; - type: 'completed' | 'submitted' | 'posted' | 'review'; - username: string; - avatar_url?: string | null; - detail: string; + type: 'bounty_created' | 'bounty_funded' | 'pr_submitted' | 'bounty_completed'; + user: string; + bounty_title: string; + amount?: string; timestamp: string; } -// Mock events for when API doesn't return activity -const MOCK_EVENTS: ActivityEvent[] = [ - { - id: '1', - type: 'completed', - username: 'devbuilder', - detail: '$500 USDC from Bounty #42', - timestamp: new Date(Date.now() - 3 * 60 * 1000).toISOString(), - }, - { - id: '2', - type: 'submitted', - username: 'KodeSage', - detail: 'PR to Bounty #38', - timestamp: new Date(Date.now() - 15 * 60 * 1000).toISOString(), - }, - { - id: '3', - type: 'posted', - username: 'SolanaLabs', - detail: 'Bounty #145 — $3,500 USDC', - timestamp: new Date(Date.now() - 45 * 60 * 1000).toISOString(), - }, - { - id: '4', - type: 'review', - username: 'AI Review', - detail: 'Bounty #42 — 8.5/10', - timestamp: new Date(Date.now() - 2 * 60 * 60 * 1000).toISOString(), - }, -]; +const EVENT_CONFIG = { + bounty_created: { icon: Zap, color: 'text-purple', label: 'created' }, + bounty_funded: { icon: DollarSign, color: 'text-emerald', label: 'funded' }, + pr_submitted: { icon: GitPullRequest, color: 'text-status-info', label: 'submitted PR for' }, + bounty_completed: { icon: Star, color: 'text-magenta', label: 'completed' }, +}; -function getActionText(type: ActivityEvent['type']) { - switch (type) { - case 'completed': return 'earned'; - case 'submitted': return 'submitted'; - case 'posted': return 'posted'; - case 'review': return 'AI Review passed for'; - default: return 'updated'; - } -} - -function EventItem({ event }: { event: ActivityEvent }) { - const isMagenta = event.type === 'review'; - return ( -
- {event.username} - {' '}{getActionText(event.type)}{' '} - {event.detail} -
- {timeAgo(event.timestamp)} -