diff --git a/frontend/src/components/home/ActivityFeed.tsx b/frontend/src/components/home/ActivityFeed.tsx index 8b6b4b904..91795e3b4 100644 --- a/frontend/src/components/home/ActivityFeed.tsx +++ b/frontend/src/components/home/ActivityFeed.tsx @@ -80,7 +80,11 @@ export function ActivityFeed({ events }: { events?: ActivityEvent[] }) { const [visibleEvents, setVisibleEvents] = useState(displayEvents.slice(0, 4)); useEffect(() => { - setVisibleEvents(displayEvents.slice(0, 4)); + if (events?.length) { + setVisibleEvents(events.slice(0, 4)); + } else { + setVisibleEvents(MOCK_EVENTS.slice(0, 4)); + } }, [events]); return ( @@ -110,3 +114,5 @@ export function ActivityFeed({ events }: { events?: ActivityEvent[] }) { ); } + +export type { ActivityEvent }; diff --git a/frontend/src/pages/HomePage.tsx b/frontend/src/pages/HomePage.tsx index 180849b3f..e47af6044 100644 --- a/frontend/src/pages/HomePage.tsx +++ b/frontend/src/pages/HomePage.tsx @@ -5,12 +5,14 @@ import { ActivityFeed } from '../components/home/ActivityFeed'; import { HowItWorksCondensed } from '../components/home/HowItWorksCondensed'; import { FeaturedBounties } from '../components/home/FeaturedBounties'; import { WhySolFoundry } from '../components/home/WhySolFoundry'; +import { useActivity } from '../hooks/useActivity'; export function HomePage() { + const { data: events } = useActivity(); return ( - +