Skip to content

Commit

Permalink
add setting max with fiat values
Browse files Browse the repository at this point in the history
  • Loading branch information
jonator committed Jul 3, 2024
1 parent 6ec92a9 commit 985ec8d
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,14 @@ export const CryptoFiatInput: FunctionComponent<{
onInput("crypto")(
trimPlaceholderZeros(asset.amount.toDec().toString())
);

const priceInFiat = assetPrice.toDec();
const maxFiatValue = asset.amount
.toDec()
.mul(priceInFiat)
.toString();

onInput("fiat")(trimPlaceholderZeros(maxFiatValue));
}}
className="body2 w-14 shrink-0 transform rounded-5xl border border-osmoverse-700 py-2 px-3 text-wosmongton-200 transition duration-200 hover:border-osmoverse-850 hover:bg-osmoverse-850 hover:text-white-full disabled:opacity-80"
>
Expand Down

0 comments on commit 985ec8d

Please sign in to comment.