Skip to content

Commit

Permalink
ensure forced withdrawal labels are shown too
Browse files Browse the repository at this point in the history
  • Loading branch information
0age committed Dec 11, 2024
1 parent 6a3eb85 commit 1d2f262
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
3 changes: 2 additions & 1 deletion frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ const customTheme = darkTheme({
function AppContent() {
const [sessionToken, setSessionToken] = useState<string | null>(null);
const [isHealthy, setIsHealthy] = useState(true);
const [supportedChains, setSupportedChains] = useState<SupportedChains | null>(null);
const [supportedChains, setSupportedChains] =
useState<SupportedChains | null>(null);

return (
<ChainConfigProvider value={{ supportedChains }}>
Expand Down
13 changes: 13 additions & 0 deletions frontend/src/components/BalanceDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,19 @@ export function BalanceDisplay({
Active
</span>
)}
{balance.withdrawalStatus !== 0 && (
<span
className={`px-2 py-1 text-xs rounded ${
canExecuteWithdrawal
? 'bg-[#F97316]/10 text-[#F97316]'
: 'bg-yellow-500/10 text-yellow-500'
}`}
>
{canExecuteWithdrawal
? 'Forced Withdrawal Ready'
: `Forced Withdrawal Ready in ${balance.timeRemaining}`}
</span>
)}
</div>

{/* Balances Grid */}
Expand Down
8 changes: 2 additions & 6 deletions frontend/src/components/FinalizationThreshold.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,18 @@ 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 (
<span className="px-2 py-1 text-xs bg-[#00ff00]/10 text-[#00ff00] rounded">
Finalization: {formatResetPeriod(chainSpecific.finalizationThresholdSeconds)}
Finalization:{' '}
{formatResetPeriod(chainSpecific.finalizationThresholdSeconds)}
</span>
);
}

0 comments on commit 1d2f262

Please sign in to comment.