diff --git a/packages/lib/src/components/base/NumericInput.tsx b/packages/lib/src/components/base/NumericInput.tsx index dbcb05e4..ad5f0b1c 100644 --- a/packages/lib/src/components/base/NumericInput.tsx +++ b/packages/lib/src/components/base/NumericInput.tsx @@ -29,6 +29,8 @@ const InputLoader = () => { function NumericInput({ prefix = "", onChange, value, disabled = false, placeholder, onFocus, onBlur, loading = false, className = "", maxValue, decimalScale, minAmount }: Props) { const inputValue = value || minAmount || ""; + console.log({ inputValue }); + const { inputPlaceholder, input } = useTwapContext().uiPreferences; const _placeholder = placeholder || inputPlaceholder || "0.0"; @@ -61,7 +63,7 @@ function NumericInput({ prefix = "", onChange, value, disabled = false, placehol return; } - onChange(values.value); + onChange(values.value === "." ? "0." : values.value); }} /> diff --git a/packages/lib/src/utils.ts b/packages/lib/src/utils.ts index 779f0650..64c32086 100644 --- a/packages/lib/src/utils.ts +++ b/packages/lib/src/utils.ts @@ -1,6 +1,7 @@ import { TokenData, parsebn, eqIgnoreCase } from "@defi.org/web3-candies"; import moment from "moment"; -import { Translations } from "."; +import { Translations } from "./types"; +import {QUERY_PARAMS} from "./consts"; import BN from "bignumber.js"; import _ from "lodash"; import { useTwapStore } from "./store"; @@ -83,8 +84,12 @@ export const getQueryParam = (name: string) => { const search = window.location.search; const params = new URLSearchParams(search); + const result = params.get(name); + if (name === QUERY_PARAMS.LIMIT_PRICE && result === ".") { + return "0.1"; + } - return params.get(name); + return result; }; export const setQueryParam = (name: string, value?: string) => {