Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bridge): fix max amount button #6246

Merged
merged 5 commits into from
Jan 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)}...`
dantaik marked this conversation as resolved.
Show resolved Hide resolved
: 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