diff options
| author | Adam Soltys <[email protected]> | 2024-09-24 13:22:31 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-09-24 13:22:31 -0700 |
| commit | 8aeb0d6d818b823afec1ee7e5749971468842c9c (patch) | |
| tree | c9e131848e0903a7629372c3642c99cc8697512a /src/routes/(app)/account | |
| parent | 52871e09d9218f3f2fb2ce4bd6e97f5c1fc15480 (diff) | |
| download | coinos-ui-8aeb0d6d818b823afec1ee7e5749971468842c9c.tar.gz coinos-ui-8aeb0d6d818b823afec1ee7e5749971468842c9c.zip | |
fix signing
Diffstat (limited to 'src/routes/(app)/account')
| -rw-r--r-- | src/routes/(app)/account/[id]/+page.svelte | 19 | ||||
| -rw-r--r-- | src/routes/(app)/account/pass/+page.svelte | 29 | ||||
| -rw-r--r-- | src/routes/(app)/account/seed/+page.svelte | 26 |
3 files changed, 40 insertions, 34 deletions
diff --git a/src/routes/(app)/account/[id]/+page.svelte b/src/routes/(app)/account/[id]/+page.svelte index 3dcd99b8..06494dd8 100644 --- a/src/routes/(app)/account/[id]/+page.svelte +++ b/src/routes/(app)/account/[id]/+page.svelte @@ -1,4 +1,5 @@ <script> + import Mnemonic from "$comp/Mnemonic.svelte"; import WalletPass from "$comp/WalletPass.svelte"; import { goto } from "$app/navigation"; import { copy, fail, focus, post } from "$lib/utils"; @@ -46,28 +47,28 @@ <div class="space-y-2"> <button type="submit" - class="rounded-2xl border py-3 font-bold mx-auto bg-black text-white px-4 w-full" - >Submit</button + class="rounded-2xl border py-5 font-bold mx-auto bg-black text-white px-6 w-full" + >{$t("accounts.save")}</button > {#if mnemonic} - <div class="p-8">{mnemonic}</div> + <Mnemonic {mnemonic} /> <button on:click={() => copy(mnemonic)} type="button" - class="flex gap-2 rounded-2xl border py-3 font-bold mx-auto px-4 w-full justify-center" + class="flex gap-2 rounded-2xl border py-5 mx-auto px-6 w-full justify-center" > <Icon icon="copy" style="w-8 my-auto" /> - <div class="my-auto">Copy</div></button + <div class="my-auto">{$t("accounts.copy")}</div></button > {:else if seed} <button on:click={toggle} type="button" - class="flex gap-2 rounded-2xl border py-3 font-bold mx-auto px-4 w-full justify-center bg-primary" + class="flex gap-2 rounded-2xl border py-5 mx-auto px-6 w-full justify-center" > <Icon icon="eye" style="w-8 my-auto" /> - <div class="my-auto">Reveal mnemonic</div></button + <div class="my-auto">{$t("accounts.revealMnemonic")}</div></button > {/if} @@ -75,10 +76,10 @@ <button on:click={del} type="button" - class="flex gap-2 rounded-2xl border py-3 font-bold mx-auto px-4 w-full justify-center bg-primary" + class="flex gap-2 rounded-2xl border py-5 mx-auto px-6 w-full justify-center" > <Icon icon="trash" style="w-8 my-auto" /> - <div class="my-auto"><span class="text-red-600">Delete</span> account</div></button + <div class="my-auto">{$t("accounts.deleteAccount")}</div></button > {/if} </div> diff --git a/src/routes/(app)/account/pass/+page.svelte b/src/routes/(app)/account/pass/+page.svelte index 2ce8b168..36992a98 100644 --- a/src/routes/(app)/account/pass/+page.svelte +++ b/src/routes/(app)/account/pass/+page.svelte @@ -44,8 +44,6 @@ let child = master.derive("m/84'/0'/0'"); let pubkey = child.publicExtendedKey; let fingerprint = child.fingerprint.toString(16).padStart(8, "0"); - - let receiving = child.deriveChild(0); await post("/api/accounts", { fingerprint, pubkey, name, seed, type }); goto(`/${user.username}`); } catch (e) { @@ -59,7 +57,9 @@ <div class="space-y-5"> <div> - <h1 class="text-center text-3xl font-semibold">{$t("accounts.accountPassword")}</h1> + <h1 class="text-center text-3xl font-semibold"> + {$t("accounts.accountPassword")} + </h1> </div> <form @@ -67,7 +67,7 @@ class="container w-full mx-auto text-lg px-4 max-w-xl space-y-5" > <p class="text-secondary mb-1"> - {$t("accounts.passwordWarning")} + {$t("accounts.passwordWarning")} </p> <div class="relative"> @@ -129,10 +129,21 @@ </button> </div> - <button - class="bg-black text-white w-full px-5 py-6 text-xl rounded-2xl font-bold" - > - Submit - </button> + <div class="flex gap-2"> + <a href={`/account/seed`} class="contents"> + <button + type="button" + class="bg-primary w-full px-5 py-6 text-xl rounded-2xl font-bold" + > + {$t("accounts.back")} + </button> + </a> + <button + type="submit" + class="bg-black text-white w-full px-5 py-6 text-xl rounded-2xl font-bold" + > + {$t("accounts.next")} + </button> + </div> </form> </div> diff --git a/src/routes/(app)/account/seed/+page.svelte b/src/routes/(app)/account/seed/+page.svelte index e922d6be..4e55534b 100644 --- a/src/routes/(app)/account/seed/+page.svelte +++ b/src/routes/(app)/account/seed/+page.svelte @@ -1,4 +1,5 @@ <script> + import Mnemonic from "$comp/Mnemonic.svelte"; import { browser } from "$app/environment"; import { tick, onMount } from "svelte"; import { copy } from "$lib/utils"; @@ -13,7 +14,7 @@ onMount(async () => { if (!browser) return; - await generate(); + if (!$mnemonic) await generate(); }); let generate = async () => { @@ -22,20 +23,13 @@ </script> <div class="space-y-5"> - <h1 class="text-center text-3xl font-semibold">Seed phrase</h1> + <h1 class="text-center text-3xl font-semibold"> + {$t("accounts.seedPhrase")} + </h1> <div class="container w-full mx-auto text-lg px-4 max-w-xl space-y-5"> {#if $mnemonic} - <div - class="text-lg border p-4 rounded-2xl text-secondary grid grid-cols-3 gap-2 justify-center" - > - {#each $mnemonic.split(" ") as w, i} - <div> - <span class="select-none text-sm text-black">{i + 1}.</span> - <span>{@html w === "-" ? "—" : w}</span> - </div> - {/each} - </div> + <Mnemonic mnemonic={$mnemonic} /> {/if} <div> @@ -45,7 +39,7 @@ on:click={generate} > <Icon icon="random" style="w-8 my-auto" /> - <div class="my-auto">Regenerate</div> + <div class="my-auto">{$t("accounts.regenerate")}</div> </button> <button @@ -64,9 +58,9 @@ <a href={`/account/savings`} class="contents"> <button type="button" - class="bg-black text-white w-full px-5 py-6 text-xl rounded-2xl font-bold" + class="bg-primary w-full px-5 py-6 text-xl rounded-2xl font-bold" > - Back + {$t("accounts.back")} </button> </a> <a href={`/account/pass`} class="contents"> @@ -74,7 +68,7 @@ type="button" class="bg-black text-white w-full px-5 py-6 text-xl rounded-2xl font-bold" > - Next + {$t("accounts.next")} </button> </a> </div> |
