Skip to content

Commit

Permalink
fix frontend linting + type issues
Browse files Browse the repository at this point in the history
  • Loading branch information
0age committed Dec 6, 2024
1 parent 92cc74c commit 1951a8f
Show file tree
Hide file tree
Showing 10 changed files with 432 additions and 311 deletions.
31 changes: 30 additions & 1 deletion frontend/src/components/BalanceDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,35 @@ import { Transfer } from './Transfer';
import { InitiateForcedWithdrawalDialog } from './InitiateForcedWithdrawalDialog';
import { ForcedWithdrawalDialog } from './ForcedWithdrawalDialog';

interface Token {
tokenAddress: string;
name: string;
symbol: string;
decimals: number;
}

interface ResourceLock {
resetPeriod: number;
isMultichain: boolean;
}

interface Balance {
chainId: string;
lockId: string;
allocatableBalance: string;
allocatedBalance: string;
balanceAvailableToAllocate: string;
withdrawalStatus: number;
withdrawableAt: string;
balance: string;
tokenName: string;
token?: Token;
resourceLock?: ResourceLock;
formattedAllocatableBalance?: string;
decimals: number;
symbol: string;
}

// Utility function to format reset period
const formatResetPeriod = (seconds: number): string => {
if (seconds < 60) return `${seconds} seconds`;
Expand All @@ -23,7 +52,7 @@ export function BalanceDisplay(): JSX.Element | null {
const [isWithdrawalDialogOpen, setIsWithdrawalDialogOpen] = useState(false);
const [isExecuteDialogOpen, setIsExecuteDialogOpen] = useState(false);
const [selectedLockId, setSelectedLockId] = useState<string>('');
const [selectedLock, setSelectedLock] = useState<any>(null);
const [selectedLock, setSelectedLock] = useState<Balance | null>(null);

if (!isConnected) return null;

Expand Down
Loading

0 comments on commit 1951a8f

Please sign in to comment.