diff --git a/packages/widget/src/components/SelectTokenButton/SelectTokenButton.style.tsx b/packages/widget/src/components/SelectTokenButton/SelectTokenButton.style.tsx index 872cfabe6..6fcf5c731 100644 --- a/packages/widget/src/components/SelectTokenButton/SelectTokenButton.style.tsx +++ b/packages/widget/src/components/SelectTokenButton/SelectTokenButton.style.tsx @@ -15,8 +15,9 @@ export const SelectTokenCardHeader = styled(CardHeader, { textOverflow: 'ellipsis', whiteSpace: 'nowrap', overflow: 'hidden', - width: compact ? 92 : 224, + width: compact ? (selected ? 92 : 142) : 224, fontWeight: selected ? 500 : 400, + fontSize: selected ? '1.125rem' : '1rem', }, [`.${cardHeaderClasses.subheader}`]: { textOverflow: 'ellipsis', diff --git a/packages/widget/src/hooks/useSwapRoutes.ts b/packages/widget/src/hooks/useSwapRoutes.ts index 56bbd6fa7..98da0b72a 100644 --- a/packages/widget/src/hooks/useSwapRoutes.ts +++ b/packages/widget/src/hooks/useSwapRoutes.ts @@ -30,13 +30,14 @@ export const useSwapRoutes = () => { ], }); const [fromTokenAmount] = useDebouncedWatch([SwapFormKey.FromAmount], 320); - const { token } = useToken(fromChainId, fromTokenAddress); + const { token: fromToken } = useToken(fromChainId, fromTokenAddress); + const { token: toToken } = useToken(toChainId, toTokenAddress); const isEnabled = // Boolean(account.address) && !isNaN(fromChainId) && !isNaN(toChainId) && - Boolean(token?.address) && - Boolean(toTokenAddress) && + Boolean(fromToken?.address) && + Boolean(toToken?.address) && !isNaN(fromTokenAmount) && Number(fromTokenAmount) > 0 && !Number.isNaN(slippage); @@ -44,10 +45,10 @@ export const useSwapRoutes = () => { 'routes', account.address, fromChainId, - token?.address, + fromToken?.address, fromTokenAmount, toChainId, - toTokenAddress, + toToken?.address, toAddress, slippage, enabledBridges, @@ -91,7 +92,7 @@ export const useSwapRoutes = () => { toWalletAddress = isAddress(toAddress) ? toAddress : fromAddress; } const fromAmount = Big( - Number(fromTokenAmount) * 10 ** (token?.decimals ?? 0), + Number(fromTokenAmount) * 10 ** (fromToken?.decimals ?? 0), ).toString(); const formattedSlippage = parseFloat(slippage) / 100; return lifi.getRoutes(