diff options
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/Account.svelte | 6 | ||||
| -rw-r--r-- | src/components/WalletPass.svelte | 67 |
2 files changed, 69 insertions, 4 deletions
diff --git a/src/components/Account.svelte b/src/components/Account.svelte index 47deadcd..4bfdc4ac 100644 --- a/src/components/Account.svelte +++ b/src/components/Account.svelte @@ -1,5 +1,4 @@ <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"; @@ -11,8 +10,7 @@ $: refresh(account); let refresh = (a) => ({ seed, balance, id } = a); - let setAccount = () => - (document.cookie = `aid=${id}; path=/; max-age=86400`); + let setAccount = () => (document.cookie = `aid=${id}; path=/; max-age=86400`); </script> <a href={`/payments`} class="block" on:click={setAccount}> @@ -40,7 +38,7 @@ </button> </a> - <a href={`/invoice?account=${id}`} class="contents" on:click={setAccount}> + <a href={`/invoice`} class="contents" on:click={setAccount}> <button class="rounded-2xl border py-5 px-6 font-bold hover:opacity-80 flex bg-primary grow" > diff --git a/src/components/WalletPass.svelte b/src/components/WalletPass.svelte new file mode 100644 index 00000000..7793ecc5 --- /dev/null +++ b/src/components/WalletPass.svelte @@ -0,0 +1,67 @@ +<script> + import { focus } from "$lib/utils"; + import { t } from "$lib/translations"; + import Icon from "$comp/Icon.svelte"; + export let cancel, password, submit; + let revealPassword; +</script> + +<div + class="fixed inset-0 bg-gray-600 bg-opacity-50 overflow-y-auto h-full w-full z-20" +> + <div + class="relative top-1/3 mx-auto p-5 border w-96 shadow-lg rounded-md bg-white space-y-5" + > + <h1 class="text-center text-2xl font-semibold"> + {$t("payments.enterWalletPass")} + </h1> + <form on:submit|preventDefault={submit}> + <div class="relative mb-5"> + {#if revealPassword} + <input + name="password" + type="text" + required + class="bg-primary" + bind:value={password} + autocapitalize="none" + use:focus + /> + {:else} + <input + name="password" + type="password" + required + class="bg-primary" + bind:value={password} + autocapitalize="none" + use:focus + /> + {/if} + <button + type="button" + on:click={() => (revealPassword = !revealPassword)} + class="absolute right-5 top-6" + > + <Icon icon={revealPassword ? "eye" : "eye-off"} /> + </button> + </div> + <div class="w-full flex"> + <button + type="button" + class="border-2 border-black rounded-xl font-semibold mx-auto py-3 w-40 hover:opacity-80 mx-auto" + on:click={cancel} + on:keydown={cancel} + > + <div class="my-auto">Cancel</div> + </button> + <button + type="submit" + class="border-2 border-black rounded-xl font-semibold mx-auto py-3 w-40 hover:opacity-80 mx-auto" + > + <div class="my-auto">Submit</div> + </button> + </div> + </form> + </div> +</div> |
