diff --git a/src/components/Swap/SwapActionButton/SwapButton.tsx b/src/components/Swap/SwapActionButton/SwapButton.tsx index 8994440b5..337428632 100644 --- a/src/components/Swap/SwapActionButton/SwapButton.tsx +++ b/src/components/Swap/SwapActionButton/SwapButton.tsx @@ -29,8 +29,8 @@ import useOnSubmit from './useOnSubmit' export default function SwapButton({ disabled }: { disabled: boolean }) { const { account, chainId } = useWeb3React() const { - [Field.INPUT]: { usdc: inputUSDC }, - [Field.OUTPUT]: { usdc: outputUSDC }, + [Field.INPUT]: { usdc: inputUSDC, currency: inputCurrency }, + [Field.OUTPUT]: { usdc: outputUSDC, currency: outputCurrency }, trade: { trade, gasUseEstimateUSD }, approval, allowance, @@ -40,6 +40,7 @@ export default function SwapButton({ disabled }: { disabled: boolean }) { const deadline = useTransactionDeadline() const feeOptions = useAtomValue(feeOptionsAtom) const color = useTokenColorExtraction() + const missingToken = !inputCurrency || !outputCurrency const permit2Enabled = usePermit2Enabled() const { callback: swapRouterCallback } = useSwapCallback({ @@ -108,7 +109,7 @@ export default function SwapButton({ disabled }: { disabled: boolean }) { return ( <> - Review swap + {missingToken ? Select token : Review swap} {trade && ( diff --git a/src/components/Swap/Toolbar/Toolbar.test.tsx b/src/components/Swap/Toolbar/Toolbar.test.tsx index 78c058150..5e5955edd 100644 --- a/src/components/Swap/Toolbar/Toolbar.test.tsx +++ b/src/components/Swap/Toolbar/Toolbar.test.tsx @@ -58,7 +58,7 @@ describe('Toolbar', () => { } ) expect(component.queryByTestId('toolbar')).toBeNull() - expect(component.queryByText('Review swap')).toBeTruthy() // should be disabled + expect(component.queryByText('Select token')).toBeTruthy() // should be disabled }) it('should render with both currencies specified, no amount input', () => { diff --git a/src/components/TokenSelect/TokenButton.tsx b/src/components/TokenSelect/TokenButton.tsx index bac88c8e5..2ed2bf768 100644 --- a/src/components/TokenSelect/TokenButton.tsx +++ b/src/components/TokenSelect/TokenButton.tsx @@ -63,7 +63,7 @@ export default function TokenButton({ value, approved, disabled, onClick }: Toke color={'onAccent'} style={{ maxWidth: '10rem', textOverflow: 'ellipsis', overflow: 'hidden' }} > - Select a token + Select token )} diff --git a/src/components/TokenSelect/index.test.tsx b/src/components/TokenSelect/index.test.tsx index 1b739c452..233e0d14c 100644 --- a/src/components/TokenSelect/index.test.tsx +++ b/src/components/TokenSelect/index.test.tsx @@ -31,7 +31,7 @@ describe('TokenSelect.tsx', () => { const widget = renderTokenSelect(onTokenSelectorClick) await user.click(widget.getByRole('button')) - expect(widget.getByTestId('dialog-header').textContent).toBe('Select a token') + expect(widget.getByTestId('dialog-header').textContent).toBe('Select token') }) it('should halt if the handler promise resolves to false', async () => { const user = userEvent.setup() diff --git a/src/components/TokenSelect/index.tsx b/src/components/TokenSelect/index.tsx index 5a5785239..1a93aa2e1 100644 --- a/src/components/TokenSelect/index.tsx +++ b/src/components/TokenSelect/index.tsx @@ -95,14 +95,14 @@ export function TokenSelectDialogContent({ value, onSelect, onClose }: TokenSele if (!listHasTokens && isLoaded) { return ( -
Select a token} /> +
Select token} />
) } return ( -
Select a token} /> +
Select token} />