Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
denis-orbs committed Apr 2, 2024
1 parent b89cac6 commit 42f97af
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/lib/src/components/base/NumericInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -61,7 +63,7 @@ function NumericInput({ prefix = "", onChange, value, disabled = false, placehol
return;
}

onChange(values.value);
onChange(values.value === "." ? "0." : values.value);
}}
/>
</StyledFlex>
Expand Down
9 changes: 7 additions & 2 deletions packages/lib/src/utils.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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) => {
Expand Down

0 comments on commit 42f97af

Please sign in to comment.