From 55afbae3b49c46688527bda37c0e39254d88f88f Mon Sep 17 00:00:00 2001 From: james-a-morris Date: Fri, 24 Nov 2023 11:22:47 -0500 Subject: [PATCH] fix: only show invalid amt when there's an amount --- src/views/Bridge/components/AmountInput.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/views/Bridge/components/AmountInput.tsx b/src/views/Bridge/components/AmountInput.tsx index 0410c97b6..880d56846 100644 --- a/src/views/Bridge/components/AmountInput.tsx +++ b/src/views/Bridge/components/AmountInput.tsx @@ -4,7 +4,7 @@ import { BigNumber, utils } from "ethers"; import { Text } from "components/Text"; import { UnstyledButton } from "components/Button"; -import { QUERIESV2, Route, getToken } from "utils"; +import { QUERIESV2, Route, getToken, isDefined } from "utils"; import BridgeInputErrorAlert from "./BridgeAlert"; import { AmountInputError } from "../utils"; @@ -36,7 +36,9 @@ export function AmountInput({ const token = getToken(selectedRoute.fromTokenSymbol); - const isAmountValid = !Boolean(validationError); + // Valid if no input, otherwise check if there's not an error + const isAmountValid = + (amountInput ?? "") === "" || !isDefined(validationError); return ( @@ -229,4 +231,5 @@ const AmountInnerInput = styled.input` } /* Firefox */ -moz-appearance: textfield; + appearance: textfield; `;