aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/WalletPass.svelte
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-03-04 23:06:35 -0800
committerAdam Soltys <[email protected]>2026-03-04 23:06:35 -0800
commite5f37b003d93a17c2a9958697269b2d3228d8830 (patch)
treee2c3a3c4d1bec48d323e830f5be35d5832845a9a /src/components/WalletPass.svelte
parente6882c6a8987e23215a2538b242431ae603c7101 (diff)
downloadcoinos-ui-e5f37b003d93a17c2a9958697269b2d3228d8830.tar.gz
coinos-ui-e5f37b003d93a17c2a9958697269b2d3228d8830.zip
tuning
Diffstat (limited to 'src/components/WalletPass.svelte')
-rw-r--r--src/components/WalletPass.svelte100
1 files changed, 0 insertions, 100 deletions
diff --git a/src/components/WalletPass.svelte b/src/components/WalletPass.svelte
deleted file mode 100644
index a3f00994..00000000
--- a/src/components/WalletPass.svelte
+++ /dev/null
@@ -1,100 +0,0 @@
-<script lang="ts">
- import PhEyeBold from "virtual:icons/ph/eye-bold";
- import PhEyeSlashBold from "virtual:icons/ph/eye-slash-bold";
- import { preventDefault } from "svelte/legacy";
-
- import { focus } from "$lib/utils";
- import { t } from "$lib/translations";
- import {
- rememberForOptions,
- defaultRememberForMs,
- rememberWalletPassword,
- forgetWalletPassword,
- } from "$lib/passwordCache";
- let { cancel = $bindable(), password = $bindable(), submit } = $props();
- let revealPassword = $state();
- let rememberForMs = $state(defaultRememberForMs);
-
- let handleSubmit = async () => {
- if (rememberForMs) {
- rememberWalletPassword(password, rememberForMs);
- } else {
- forgetWalletPassword();
- }
- await submit();
- };
-</script>
-
-<div class="fixed inset-0 bg-gray-600/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 onsubmit={preventDefault(handleSubmit)}>
- <div class="relative mb-5">
- {#if revealPassword}
- <input
- name="password"
- data-testid="walletpass-input"
- type="text"
- required
- bind:value={password}
- autocapitalize="none"
- use:focus
- />
- {:else}
- <input
- name="password"
- data-testid="walletpass-input"
- type="password"
- required
- bind:value={password}
- autocapitalize="none"
- use:focus
- />
- {/if}
- <button
- type="button"
- onclick={() => (revealPassword = !revealPassword)}
- class="absolute right-5 top-1/2"
- aria-label={revealPassword ? "Hide password" : "Show password"}
- >
- {#if revealPassword}
- <PhEyeBold width="32" />
- {:else}
- <PhEyeSlashBold width="32" />
- {/if}
- </button>
- </div>
- <div class="mb-5 space-y-2">
- <label for="rememberFor" class="text-sm text-gray-500">Remember for</label>
- <select
- id="rememberFor"
- class="w-full"
- value={rememberForMs}
- onchange={(e) => (rememberForMs = Number((e.target as HTMLSelectElement).value))}
- >
- {#each rememberForOptions as option}
- <option value={option.ms}>{option.label}</option>
- {/each}
- </select>
- </div>
- <div class="w-full flex justify-center gap-2">
- <button
- type="button"
- data-testid="walletpass-cancel"
- class="border rounded-2xl font-semibold mx-auto py-5 px-6 hover:opacity-80 mx-auto grow"
- onclick={cancel}
- onkeydown={cancel}
- >
- <div class="my-auto">Cancel</div>
- </button>
- <button
- type="submit"
- data-testid="walletpass-submit"
- class="border rounded-2xl font-semibold mx-auto py-5 px-6 hover:opacity-80 mx-auto grow"
- >
- <div class="my-auto">Submit</div>
- </button>
- </div>
- </form>
- </div>
-</div>