Skip to content

Commit

Permalink
Add disableMultiplyBy1e18 flag to IntegerInput component (#609)
Browse files Browse the repository at this point in the history
  • Loading branch information
damianmarti authored Nov 21, 2023
1 parent 9680b07 commit a586fc2
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { CommonInputProps, InputBase, IntegerVariant, isValidInteger } from "~~/

type IntegerInputProps = CommonInputProps<string | bigint> & {
variant?: IntegerVariant;
disableMultiplyBy1e18?: boolean;
};

export const IntegerInput = ({
Expand All @@ -12,6 +13,7 @@ export const IntegerInput = ({
placeholder,
disabled,
variant = IntegerVariant.UINT256,
disableMultiplyBy1e18 = false,
}: IntegerInputProps) => {
const [inputError, setInputError] = useState(false);
const multiplyBy1e18 = useCallback(() => {
Expand Down Expand Up @@ -41,7 +43,8 @@ export const IntegerInput = ({
onChange={onChange}
disabled={disabled}
suffix={
!inputError && (
!inputError &&
!disableMultiplyBy1e18 && (
<div
className="space-x-4 flex tooltip tooltip-top tooltip-secondary before:content-[attr(data-tip)] before:right-[-10px] before:left-auto before:transform-none"
data-tip="Multiply by 10^18 (wei)"
Expand Down

0 comments on commit a586fc2

Please sign in to comment.