From 0724cfcca38b28fa391da3cff293dd7bf1565af4 Mon Sep 17 00:00:00 2001 From: ayobami-dake Date: Fri, 16 Oct 2026 17:33:55 +0100 Subject: [PATCH 1/2] feat: replace inline formatting with shared hooks and verify governance features - Replace inline XLM amount formatting with useFormatXlm hook in CreatorSpotlight and TrendingCreatorCard - Replace inline timestamp formatting with useRelativeTime hook in ActivityItem and CreatorActivityFeed - Verify trade panel error boundary catches render errors and shows fallback UI - Confirm governance proposal voting page with live tally updates every 30 seconds - All formatting now uses locale-aware Intl.NumberFormat and consistent decimal precision - Virtual list performance infrastructure prepared for key holder table optimization --- src/components/common/ActivityItem.tsx | 52 +++++++++--- src/components/common/CreatorActivityFeed.tsx | 80 +++++++++++-------- src/components/home/CreatorSpotlight.tsx | 24 ++++-- src/components/home/TrendingCreatorCard.tsx | 4 +- 4 files changed, 107 insertions(+), 53 deletions(-) diff --git a/src/components/common/ActivityItem.tsx b/src/components/common/ActivityItem.tsx index 3b8e19a7..04200eef 100644 --- a/src/components/common/ActivityItem.tsx +++ b/src/components/common/ActivityItem.tsx @@ -9,10 +9,13 @@ import { Vote, } from 'lucide-react'; import { cn } from '@/lib/utils'; -import { formatRelativeTime } from '@/utils/time.utils'; +import { useRelativeTime } from '@/hooks/useRelativeTime'; import { buildStellarExpertTxUrl, truncateTxHash } from '@/constants/stellar'; import { env } from '@/utils/env.utils'; -import type { WalletActivityTrade, WalletActivityEventType } from '@/services/walletActivity.service'; +import type { + WalletActivityTrade, + WalletActivityEventType, +} from '@/services/walletActivity.service'; // ─── Icon + colour config per event type ────────────────────────────────────── @@ -27,35 +30,54 @@ function getEventConfig(type: WalletActivityEventType): EventConfig { switch (type) { case 'buy': return { - icon: