Skip to content

Commit

Permalink
fix(bridge): fix max amount button (#6246)
Browse files Browse the repository at this point in the history
* fix(bridge): fix max amount button

* feat(bridge): reduce max token amount to four decimal digits
  • Loading branch information
shadab-taiko authored Jan 3, 2023
1 parent 197ae01 commit 409e7a4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/bridge-ui/src/components/form/BridgeForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import FaucetModal from "../modals/FaucetModal.svelte";
let amount: string;
let amountInput: HTMLInputElement;
let requiresAllowance: boolean = true;
let btnDisabled: boolean = true;
let tokenBalance: string;
Expand Down Expand Up @@ -244,6 +245,7 @@
function useFullAmount() {
amount = tokenBalance;
amountInput.value = tokenBalance.toString();
}
function updateAmount(e: any) {
Expand Down Expand Up @@ -273,7 +275,7 @@
<button class="label-text" on:click={useFullAmount}
>{$_("bridgeForm.maxLabel")}
{tokenBalance.length > 10
? `${truncateString(tokenBalance)}...`
? `${truncateString(tokenBalance, 6)}...`
: tokenBalance}
{$token.symbol}
</button>{/if}
Expand All @@ -289,6 +291,7 @@
on:input={updateAmount}
class="input input-primary bg-dark-4 input-md md:input-lg w-full focus:ring-0"
name="amount"
bind:this={amountInput}
/>
<SelectToken />
</label>
Expand Down

0 comments on commit 409e7a4

Please sign in to comment.