Commit 37a50372 authored by Moody Salem's avatar Moody Salem

improve responsiveness of header

parent ab99cc61
This diff is collapsed.
...@@ -46,10 +46,8 @@ const HeaderFrame = styled.div` ...@@ -46,10 +46,8 @@ const HeaderFrame = styled.div`
background-color: ${({ theme }) => theme.bg0}; background-color: ${({ theme }) => theme.bg0};
${({ theme }) => theme.mediaWidth.upToMedium` ${({ theme }) => theme.mediaWidth.upToMedium`
grid-template-columns: 1fr; display: flex;
padding: 0 1rem; padding: 0 1rem;
width: calc(100%);
position: relative;
`}; `};
${({ theme }) => theme.mediaWidth.upToExtraSmall` ${({ theme }) => theme.mediaWidth.upToExtraSmall`
......
...@@ -34,6 +34,7 @@ export default function useWrapCallback( ...@@ -34,6 +34,7 @@ export default function useWrapCallback(
return useMemo(() => { return useMemo(() => {
if (!wethContract || !chainId || !inputCurrency || !outputCurrency) return NOT_APPLICABLE if (!wethContract || !chainId || !inputCurrency || !outputCurrency) return NOT_APPLICABLE
const hasInputAmount = Boolean(inputAmount?.greaterThan('0'))
const sufficientBalance = inputAmount && balance && !balance.lessThan(inputAmount) const sufficientBalance = inputAmount && balance && !balance.lessThan(inputAmount)
if (inputCurrency === ETHER && currencyEquals(WETH9[chainId], outputCurrency)) { if (inputCurrency === ETHER && currencyEquals(WETH9[chainId], outputCurrency)) {
...@@ -50,7 +51,7 @@ export default function useWrapCallback( ...@@ -50,7 +51,7 @@ export default function useWrapCallback(
} }
} }
: undefined, : undefined,
inputError: sufficientBalance ? undefined : 'Insufficient ETH balance', inputError: sufficientBalance ? undefined : hasInputAmount ? 'Insufficient ETH balance' : 'Enter ETH amount',
} }
} else if (currencyEquals(WETH9[chainId], inputCurrency) && outputCurrency === ETHER) { } else if (currencyEquals(WETH9[chainId], inputCurrency) && outputCurrency === ETHER) {
return { return {
...@@ -66,7 +67,7 @@ export default function useWrapCallback( ...@@ -66,7 +67,7 @@ export default function useWrapCallback(
} }
} }
: undefined, : undefined,
inputError: sufficientBalance ? undefined : 'Insufficient WETH balance', inputError: sufficientBalance ? undefined : hasInputAmount ? 'Insufficient WETH balance' : 'Enter WETH amount',
} }
} else { } else {
return NOT_APPLICABLE return NOT_APPLICABLE
......
...@@ -50,7 +50,7 @@ const BodyWrapper = styled.div` ...@@ -50,7 +50,7 @@ const BodyWrapper = styled.div`
${({ theme }) => theme.mediaWidth.upToSmall` ${({ theme }) => theme.mediaWidth.upToSmall`
padding: 16px; padding: 16px;
padding-top: 2rem; padding-top: 6rem;
`}; `};
` `
......
...@@ -94,7 +94,6 @@ export default function Swap({ history }: RouteComponentProps) { ...@@ -94,7 +94,6 @@ export default function Swap({ history }: RouteComponentProps) {
parsedAmount, parsedAmount,
currencies, currencies,
inputError: swapInputError, inputError: swapInputError,
// v3Trade,
} = useDerivedSwapInfo() } = useDerivedSwapInfo()
const { wrapType, execute: onWrap, inputError: wrapInputError } = useWrapCallback( const { wrapType, execute: onWrap, inputError: wrapInputError } = useWrapCallback(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment