Skip to content

Commit e5bc2d6

Browse files
committed
Added Fill Max button to label
1 parent 1a36cbc commit e5bc2d6

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

  • src/routes/[network]/(account)/swap/[basecontract]/[basesymbol]/[quotecontract]/[quotesymbol]

src/routes/[network]/(account)/swap/[basecontract]/[basesymbol]/[quotecontract]/[quotesymbol]/+page.svelte

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,11 @@
168168
transact();
169169
}
170170
}
171+
172+
function max() {
173+
baseInput?.set(baseBalance.balance);
174+
baseQuantity = baseBalance.balance;
175+
}
171176
</script>
172177

173178
{#snippet Success()}
@@ -233,10 +238,16 @@
233238

234239
{#snippet BaseField()}
235240
<Stack class="gap-1">
236-
<Label for="base-quantity">
241+
<Label
242+
for="base-quantity"
243+
class="items-baseline-last grid h-10 grid-cols-[1fr_auto] items-center"
244+
>
237245
{m.common_send_tokens({
238246
token: data.base.name
239247
})}
248+
<Button variant="tertiary" disabled={!context.account} onclick={max}>
249+
{m.common_fill_max()}
250+
</Button>
240251
</Label>
241252
<AssetInput
242253
autofocus
@@ -252,7 +263,10 @@
252263

253264
{#snippet QuoteField()}
254265
<Stack class="gap-1">
255-
<Label for="base-quantity">
266+
<Label
267+
for="base-quantity"
268+
class="items-baseline-last grid h-10 grid-cols-[1fr_auto] items-center"
269+
>
256270
{m.common_receive_tokens({
257271
token: data.quote.name
258272
})}

0 commit comments

Comments
 (0)