aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/Account.svelte
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-09-12 15:23:45 -0700
committerAdam Soltys <[email protected]>2024-09-17 09:19:25 -0700
commit2114156be3f89a2ef4c5bd13fd6d7a51d8fbc135 (patch)
treeae764021c0f9017493366862d42ea6cac904a76e /src/components/Account.svelte
parent1f63848ca9fb01336f04b41434de1cc06a5b3d93 (diff)
downloadcoinos-ui-2114156be3f89a2ef4c5bd13fd6d7a51d8fbc135.tar.gz
coinos-ui-2114156be3f89a2ef4c5bd13fd6d7a51d8fbc135.zip
self custodial send
Diffstat (limited to 'src/components/Account.svelte')
-rw-r--r--src/components/Account.svelte17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/components/Account.svelte b/src/components/Account.svelte
index eb1b0bac..f83068b5 100644
--- a/src/components/Account.svelte
+++ b/src/components/Account.svelte
@@ -1,4 +1,5 @@
<script>
+ import { account as acc } from "$lib/store";
import Icon from "$comp/Icon.svelte";
import Balance from "$comp/Balance.svelte";
import { t } from "$lib/translations";
@@ -6,19 +7,17 @@
export let user, rate, account;
let { seed, balance, id } = account;
$: type = seed ? "Savings" : "Cash";
+
+ let setAccount = () =>
+ document.cookie = `account=${id}; path=/; max-age=86400`;
</script>
-<a href={`/payments`} class="block">
+<a href={`/payments`} class="block" on:click={setAccount}>
<div class="border rounded-xl shadow p-4 space-y-5">
- <div class="flex justify-center lg:justify-start">
- <Balance {balance} {user} {rate} />
- <div class="ml-auto text-right">
- <div>{type} account</div>
- </div>
- </div>
+ <Balance {balance} {user} {rate} />
<div class="flex flex-wrap gap-3 justify-center w-full text-xl">
- <a href={`/send`} class="contents grow">
+ <a href={`/send`} class="contents grow" on:click={setAccount}>
<button
type="button"
class="rounded-2xl border py-5 px-6 font-bold hover:opacity-80 flex bg-primary grow"
@@ -30,7 +29,7 @@
</button>
</a>
- <a href={`/invoice`} class="contents">
+ <a href={`/invoice?account=${id}`} class="contents" on:click={setAccount}>
<button
class="rounded-2xl border py-5 px-6 font-bold hover:opacity-80 flex bg-primary grow"
>