diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 02c3639..33959ef 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -36,94 +36,96 @@ const customTheme = darkTheme({ function AppContent() { const [sessionToken, setSessionToken] = useState(null); const [isHealthy, setIsHealthy] = useState(true); - const [, setChainConfig] = useState(null); + const [supportedChains, setSupportedChains] = useState(null); return ( -
-
-
-
-

- Sm - all - ocator - 🤏 -

-

- A minimalistic server-based allocator for{' '} + +

+
+
+
+

+ Sm + all + ocator + 🤏 +

+

+ A minimalistic server-based allocator for{' '} + + The Compact + {' '} + 🤝 +

+
+
- The Compact - {' '} - 🤝 -

-
-
- - - - - - - -
-
-
- -
-
-
- {/* Health Check Status */} -
- + + + + +
+
+
- {/* Only show these components if the server is healthy */} - {isHealthy && ( - <> - {/* Deposit Form */} - {sessionToken && } +
+
+
+ {/* Health Check Status */} +
+ +
- {/* Balance Display */} - {sessionToken && ( -
- -
- )} - - )} + {/* Only show these components if the server is healthy */} + {isHealthy && ( + <> + {/* Deposit Form */} + {sessionToken && } - {/* API Section - always visible */} - + {/* Balance Display */} + {sessionToken && ( +
+ +
+ )} + + )} + + {/* API Section - always visible */} + +
-
- - + + + ); } @@ -133,9 +135,7 @@ function App() { - - - + diff --git a/frontend/src/components/FinalizationThreshold.tsx b/frontend/src/components/FinalizationThreshold.tsx index 4024e64..7f93630 100644 --- a/frontend/src/components/FinalizationThreshold.tsx +++ b/frontend/src/components/FinalizationThreshold.tsx @@ -9,18 +9,22 @@ interface FinalizationThresholdProps { export function FinalizationThreshold({ chainId }: FinalizationThresholdProps) { const { supportedChains } = useChainConfig(); + console.log('FinalizationThreshold - chainId:', chainId); + console.log('FinalizationThreshold - supportedChains:', supportedChains); + if (!supportedChains) return null; const chainSpecific = supportedChains.find( (chain: SupportedChain) => chain.chainId === chainId.toString() ); + console.log('FinalizationThreshold - chainSpecific:', chainSpecific); + if (!chainSpecific) return null; return ( - Finalization:{' '} - {formatResetPeriod(chainSpecific.finalizationThresholdSeconds)} + Finalization: {formatResetPeriod(chainSpecific.finalizationThresholdSeconds)} ); } diff --git a/frontend/src/components/HealthCheck.tsx b/frontend/src/components/HealthCheck.tsx index 972f764..b9731ee 100644 --- a/frontend/src/components/HealthCheck.tsx +++ b/frontend/src/components/HealthCheck.tsx @@ -1,5 +1,4 @@ import React, { useEffect, useState } from 'react'; -import { ChainConfigProvider } from '../contexts/ChainConfigContext'; import { SupportedChains } from '../types/chain'; interface HealthStatus { @@ -80,55 +79,51 @@ const HealthCheck: React.FC = ({ } return ( - -
- {/* Allocator Address and Status */} -
-
- Allocator: - - {healthData.allocatorAddress} - -
-
- Status: - - {healthData.status.charAt(0).toUpperCase() + - healthData.status.slice(1)} - -
+
+ {/* Allocator Address and Status */} +
+
+ Allocator: + + {healthData.allocatorAddress} + +
+
+ Status: + + {healthData.status.charAt(0).toUpperCase() + + healthData.status.slice(1)} +
+
- {/* Signer and Last Checked */} -
-
- Signer: - - {healthData.signingAddress} - -
-
- Last Checked: - - {new Date(healthData.timestamp).toLocaleTimeString(undefined, { - hour12: false, - hour: '2-digit', - minute: '2-digit', - second: '2-digit', - })} - -
+ {/* Signer and Last Checked */} +
+
+ Signer: + + {healthData.signingAddress} + +
+
+ Last Checked: + + {new Date(healthData.timestamp).toLocaleTimeString(undefined, { + hour12: false, + hour: '2-digit', + minute: '2-digit', + second: '2-digit', + })} +
- +
); };