diff --git a/src/components/Swap/TokenInput.tsx b/src/components/Swap/TokenInput.tsx index 7caa96bda..bb7884921 100644 --- a/src/components/Swap/TokenInput.tsx +++ b/src/components/Swap/TokenInput.tsx @@ -101,6 +101,7 @@ export const TokenInput = forwardRef theme['interactive']}; + } +` + const StyledTokenButton = styled(Button)<{ approved?: boolean; presetValue?: boolean }>` border-radius: ${({ theme }) => theme.borderRadius.medium}em; min-height: 2em; padding: 0.25em 0.5em 0.25em 0.25em; + ${({ presetValue }) => presetValue && presetValueCss}; + :enabled { transition: none; } @@ -54,19 +63,21 @@ interface TokenButtonProps { approved?: boolean disabled?: boolean onClick: () => void + hasPresetValue?: boolean } -export default function TokenButton({ value, approved, disabled, onClick }: TokenButtonProps) { +export default function TokenButton({ value, approved, disabled, onClick, hasPresetValue }: TokenButtonProps) { const chainInfo = getChainInfo(value?.chainId) const chainSrc = getNativeLogoURI(value?.chainId) return ( {value ? ( @@ -85,7 +96,7 @@ export default function TokenButton({ value, approved, disabled, onClick }: Toke Select token )} - + {!hasPresetValue && } ) diff --git a/src/components/TokenSelect/index.tsx b/src/components/TokenSelect/index.tsx index 93ca74d88..60c18e011 100644 --- a/src/components/TokenSelect/index.tsx +++ b/src/components/TokenSelect/index.tsx @@ -164,6 +164,7 @@ interface TokenSelectProps { onSelect: (value: Currency) => void chainIdsAllowed: number[] tokenList: TokenListItem[] + hasPresetValue?: boolean } export default memo(function TokenSelect({ @@ -174,6 +175,7 @@ export default memo(function TokenSelect({ onSelect, chainIdsAllowed, tokenList, + hasPresetValue, }: TokenSelectProps) { usePrefetchBalances() @@ -191,7 +193,13 @@ export default memo(function TokenSelect({ ) return ( <> - + {open && (