aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/Password.svelte
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-11-07 21:16:25 -0800
committerAdam Soltys <[email protected]>2024-11-08 09:27:40 -0800
commit32fcc461cd43c8907df5e306d520bb671307eab1 (patch)
tree0253780c569998b6c1a5f43026586e94916c3fee /src/components/Password.svelte
parentbe5aa52cea1d57c875cfb22d25c6a866b8de2239 (diff)
downloadcoinos-ui-32fcc461cd43c8907df5e306d520bb671307eab1.tar.gz
coinos-ui-32fcc461cd43c8907df5e306d520bb671307eab1.zip
svelte 5
Diffstat (limited to 'src/components/Password.svelte')
-rw-r--r--src/components/Password.svelte18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/components/Password.svelte b/src/components/Password.svelte
index cb57eec5..ac2a9a44 100644
--- a/src/components/Password.svelte
+++ b/src/components/Password.svelte
@@ -1,13 +1,15 @@
<script>
+ import { preventDefault } from 'svelte/legacy';
+
import Icon from "$comp/Icon.svelte";
import { focus, fail, post } from "$lib/utils";
import { password as pw, passwordPrompt } from "$lib/store";
- export let user;
+ let { user } = $props();
- let password;
+ let password = $state();
let { username } = user;
- let revealPassword = false;
+ let revealPassword = $state(false);
let cancel = () => ($passwordPrompt = false);
@@ -31,7 +33,7 @@
<h1 class="text-center text-2xl font-semibold">
Please enter your password
</h1>
- <form on:submit|preventDefault={submit}>
+ <form onsubmit={preventDefault(submit)}>
<div class="relative mb-5">
{#if revealPassword}
<input
@@ -54,21 +56,21 @@
{/if}
<button
type="button"
- on:click={() => (revealPassword = !revealPassword)}
+ onclick={() => (revealPassword = !revealPassword)}
class="absolute right-5 top-6"
>
<iconify-icon
icon={revealPassword ? "ph:eye-bold" : "ph:eye-slash-bold"}
width="32"
- />
+></iconify-icon>
</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}
+ onclick={cancel}
+ onkeydown={cancel}
>
<div class="my-auto">Cancel</div>
</button>