From 131d52bb9788a3145d102556e49b8404ad2967df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timot=C3=A9=C3=A9?= Date: Thu, 23 Jul 2026 15:55:55 +0100 Subject: [PATCH] fix(dashboard): remove merge/duplication artifacts in App and EventExplorer components --- dashboard/src/App.tsx | 153 +----------------- .../src/components/EventExplorerCard.tsx | 23 +-- .../src/components/EventExplorerTable.tsx | 13 +- dashboard/src/pages/EventExplorerPage.tsx | 7 +- 4 files changed, 22 insertions(+), 174 deletions(-) diff --git a/dashboard/src/App.tsx b/dashboard/src/App.tsx index f494468..415289c 100644 --- a/dashboard/src/App.tsx +++ b/dashboard/src/App.tsx @@ -17,23 +17,16 @@ export function App() { const [activeTab, setActiveTab] = useState(() => parseActiveTab(initialSearch)); useEffect(() => { - if (typeof window === 'undefined') { - return; - } - + if (typeof window === 'undefined') return; const handlePopState = () => { setActiveTab(parseActiveTab(window.location.search)); }; - window.addEventListener('popstate', handlePopState); return () => window.removeEventListener('popstate', handlePopState); }, []); useEffect(() => { - if (typeof window === 'undefined') { - return; - } - + if (typeof window === 'undefined') return; const params = new URLSearchParams(window.location.search); params.set('tab', activeTab); window.history.replaceState({}, '', `${window.location.pathname}?${params.toString()}`); @@ -56,21 +49,6 @@ export function App() { - - - - {activeTab === 'explorer' ? : } -import { DeliveryHeatmap } from './components/DeliveryHeatmap'; -import { ThemeToggle } from './components/ThemeToggle'; -import { useTheme } from './hooks/useTheme'; -import { useEventStore } from './store/eventStore'; - -export function App() { - const { theme, toggleTheme } = useTheme(); - const events = useEventStore((state) => state.events); - - return ( -
-
- -
- - -import { TemplatePreviewDemoPage } from './pages/TemplatePreviewDemoPage'; - -type Page = 'events' | 'templates'; - -export function App() { - const [currentPage, setCurrentPage] = useState('templates'); - - return ( -
- - -
- {currentPage === 'events' && } - {currentPage === 'templates' && } +
+ {activeTab === 'preferences' ? : }
- role="tab" - aria-selected={tab === 'timeline'} - className={`app-tabs__btn${tab === 'timeline' ? ' app-tabs__btn--active' : ''}`} - onClick={() => setTab('timeline')} - > - Delivery Timeline - - - - - - - - {tab === 'explorer' && } - {tab === 'timeline' && } - {tab === 'activity' && } - {tab === 'webhooks' && } - {tab === 'export-history' && } - {tab === 'search' && }
); } diff --git a/dashboard/src/components/EventExplorerCard.tsx b/dashboard/src/components/EventExplorerCard.tsx index cd905f6..f2cb673 100644 --- a/dashboard/src/components/EventExplorerCard.tsx +++ b/dashboard/src/components/EventExplorerCard.tsx @@ -18,7 +18,6 @@ function shortenAddress(address: string) { if (address.length <= 14) { return address; } - return `${address.slice(0, 6)}...${address.slice(-4)}`; } @@ -34,11 +33,8 @@ interface EventExplorerCardProps { event: BlockchainEvent; onCopyContract: (contractAddress: string) => void; isCopied: boolean; - onSelect?: (event: BlockchainEvent) => void; -} - -export function EventExplorerCard({ event, onCopyContract, isCopied, onSelect }: EventExplorerCardProps) { contractStatuses: ContractStatus[]; + onSelect?: (event: BlockchainEvent) => void; } export function EventExplorerCard({ @@ -46,6 +42,7 @@ export function EventExplorerCard({ onCopyContract, isCopied, contractStatuses, + onSelect, }: EventExplorerCardProps) { const contractStatus = contractStatuses.find((c) => c.address === event.contractAddress); const isPaused = contractStatus?.paused ?? false; @@ -77,22 +74,14 @@ export function EventExplorerCard({

{shortenAddress(event.contractAddress)}

-
diff --git a/dashboard/src/pages/EventExplorerPage.tsx b/dashboard/src/pages/EventExplorerPage.tsx index ef1f324..1319e84 100644 --- a/dashboard/src/pages/EventExplorerPage.tsx +++ b/dashboard/src/pages/EventExplorerPage.tsx @@ -268,8 +268,11 @@ export function EventExplorerPage() { {isLoading ? ( ) : currentPageEvents.length > 0 ? ( - - + ) : (

No events found