Skip to content

Commit c2400e7

Browse files
committed
Swap notice on system contract function pages
1 parent c74e86f commit c2400e7

2 files changed

Lines changed: 43 additions & 0 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<script lang="ts">
2+
import { onMount } from 'svelte';
3+
import X from 'lucide-svelte/icons/x';
4+
import * as m from '$lib/paraglide/messages';
5+
import dayjs from 'dayjs';
6+
import type { AccountState } from '$lib/state/client/account.svelte';
7+
import type { NetworkState } from '$lib/state/network.svelte';
8+
import AssetText from '$lib/components/elements/asset.svelte';
9+
import Button from '$lib/components/button/button.svelte';
10+
11+
interface Props {
12+
account?: AccountState;
13+
network: NetworkState;
14+
}
15+
let props: Props = $props();
16+
</script>
17+
18+
{#if props.account && props.network.config.legacytoken && props.account.getBalance(props.network.config.legacytoken)}
19+
<aside
20+
class="text-on-surface grid grid-cols-[auto_1fr_auto] items-center justify-items-center gap-4 rounded-lg bg-linear-to-r from-[#1C2399] to-[#2E3BFF] p-2 pr-4 shadow-lg *:row-start-1"
21+
>
22+
<div class="text-on-surface col-start-2 py-4 md:col-span-3 md:col-start-1 md:text-center">
23+
<p class="text-lg font-semibold">
24+
Vaulta now uses the {props.network.token.name} token
25+
</p>
26+
<p class="text-sm">
27+
<AssetText
28+
variant="full"
29+
value={props.account.getBalance(props.network.config.legacytoken).balance}
30+
/>
31+
available to swap.
32+
</p>
33+
</div>
34+
<Button
35+
href="/{props.network}/swap/{props.network.config.legacytoken.id.url}/{props.network.token.id
36+
.url}"
37+
>
38+
{m.common_swap()}
39+
</Button>
40+
</aside>
41+
{/if}

src/routes/[network]/(account)/ram/(forms)/buy/+page.svelte

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import BytesInput from '$lib/components/input/bytes.svelte';
1818
import AssetText from '$lib/components/elements/asset.svelte';
1919
import RamResource from '$lib/components/elements/ramresource.svelte';
20+
import SystemTokenSwap from '$lib/components/banner/systemTokenSwap.svelte';
2021
import * as m from '$lib/paraglide/messages';
2122
2223
import { BuyRAMState } from './state.svelte';
@@ -99,6 +100,7 @@
99100
</script>
100101

101102
<Stack>
103+
<SystemTokenSwap account={context.account} network={data.network} />
102104
{#if transactionId}
103105
<TransactSummary {transactionId} />
104106
<Button href={`/${data.network}/ram`} variant="secondary">

0 commit comments

Comments
 (0)