Skip to content

Commit

Permalink
fix: only show invalid amt when there's an amount
Browse files Browse the repository at this point in the history
  • Loading branch information
james-a-morris committed Nov 24, 2023
1 parent 07142ab commit 55afbae
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/views/Bridge/components/AmountInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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 (
<AmountExternalWrapper>
Expand Down Expand Up @@ -229,4 +231,5 @@ const AmountInnerInput = styled.input<IValidInput>`
}
/* Firefox */
-moz-appearance: textfield;
appearance: textfield;
`;

0 comments on commit 55afbae

Please sign in to comment.