diff options
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/Calendar.svelte | 3 | ||||
| -rw-r--r-- | src/components/Card.svelte | 3 | ||||
| -rw-r--r-- | src/components/Footer.svelte | 3 | ||||
| -rw-r--r-- | src/components/Heart.svelte | 3 | ||||
| -rw-r--r-- | src/components/Invoice.svelte | 3 | ||||
| -rw-r--r-- | src/components/LandingHeader.svelte | 22 | ||||
| -rw-r--r-- | src/components/LandingHero.svelte | 3 | ||||
| -rw-r--r-- | src/components/Left.svelte | 3 | ||||
| -rw-r--r-- | src/components/Lnurlp.svelte | 3 | ||||
| -rw-r--r-- | src/components/Lnurlw.svelte | 3 | ||||
| -rw-r--r-- | src/components/LocationsMap.svelte | 6 | ||||
| -rw-r--r-- | src/components/Lock.svelte | 3 | ||||
| -rw-r--r-- | src/components/Numpad.svelte | 3 | ||||
| -rw-r--r-- | src/components/Password.svelte | 9 | ||||
| -rw-r--r-- | src/components/Pin.svelte | 3 | ||||
| -rw-r--r-- | src/components/Pinpad.svelte | 6 | ||||
| -rw-r--r-- | src/components/RegisterOrLogin.svelte | 193 | ||||
| -rw-r--r-- | src/components/Request.svelte | 3 | ||||
| -rw-r--r-- | src/components/Spinner.svelte | 3 | ||||
| -rw-r--r-- | src/components/index.js | 0 |
20 files changed, 35 insertions, 243 deletions
diff --git a/src/components/Calendar.svelte b/src/components/Calendar.svelte index b07c136c..7d7fa570 100644 --- a/src/components/Calendar.svelte +++ b/src/components/Calendar.svelte @@ -3,8 +3,7 @@ class="absolute bottom-0 left-0 -mb-0.5 transform translate-x-1/2 -translate-y-1/2 text-black peer-placeholder-shown:text-gray-300 h-6 w-6" fill="none" viewBox="0 0 24 24" - stroke="currentColor" -> + stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" diff --git a/src/components/Card.svelte b/src/components/Card.svelte index 864465c0..60b7c818 100644 --- a/src/components/Card.svelte +++ b/src/components/Card.svelte @@ -3,8 +3,7 @@ class="absolute bottom-0 left-0 -mb-0.5 transform translate-x-1/2 -translate-y-1/2 text-black peer-placeholder-shown:text-gray-300 h-6 w-6" fill="none" viewBox="0 0 24 24" - stroke="currentColor" -> + stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" diff --git a/src/components/Footer.svelte b/src/components/Footer.svelte index d70c013c..378dce6d 100644 --- a/src/components/Footer.svelte +++ b/src/components/Footer.svelte @@ -26,8 +26,7 @@ <div> <a href="/register"> <button - class="bg-black text-white border rounded-full px-4 py-2 font-bold hover:opacity-80 text-lg" - > + class="bg-black text-white border rounded-full px-4 py-2 font-bold hover:opacity-80 text-lg"> {$t("nav.startInSeconds")} </button> </a> diff --git a/src/components/Heart.svelte b/src/components/Heart.svelte index 9bae6500..4304545f 100644 --- a/src/components/Heart.svelte +++ b/src/components/Heart.svelte @@ -4,8 +4,7 @@ class="mr-1" viewBox="0 0 24 24" fill="none" - xmlns="http://www.w3.org/2000/svg" -> + xmlns="http://www.w3.org/2000/svg"> <path d="M4.31802 6.31802C2.56066 8.07538 2.56066 10.9246 4.31802 12.682L12.0001 20.364L19.682 12.682C21.4393 10.9246 21.4393 8.07538 19.682 6.31802C17.9246 4.56066 15.0754 4.56066 13.318 6.31802L12.0001 7.63609L10.682 6.31802C8.92462 4.56066 6.07538 4.56066 4.31802 6.31802Z" stroke="currentColor" diff --git a/src/components/Invoice.svelte b/src/components/Invoice.svelte index ba436649..ad537b7b 100644 --- a/src/components/Invoice.svelte +++ b/src/components/Invoice.svelte @@ -29,8 +29,7 @@ <div class="mx-auto my-auto flex gap-2"> <a href={`/${invoice.user.username}/invoice/${$invoice.id}/tip`}> <button - class="rounded-full border py-2 px-4 font-bold hover:opacity-80 w-32" - > + class="rounded-full border py-2 px-4 font-bold hover:opacity-80 w-32"> {$t("payments.pay")} </button> </a> diff --git a/src/components/LandingHeader.svelte b/src/components/LandingHeader.svelte index d1094a1d..72dd8c71 100644 --- a/src/components/LandingHeader.svelte +++ b/src/components/LandingHeader.svelte @@ -52,11 +52,12 @@ class="border rounded-full px-6 py-2 font-bold" on:click={() => goto(`/${user.username}`)} >Home + + </button> <button class="bg-black text-white border rounded-full px-6 py-2 font-bold" - on:click={() => goto("/logout")} - > + on:click={() => goto("/logout")}> {$t("nav.signOut")} </button> {:else} @@ -64,11 +65,12 @@ class="border rounded-full px-6 py-2 font-bold hover:opacity-80" on:click={() => goto("/register")} >{$t("nav.startInSeconds")} + + </button> <button class="bg-black text-white border rounded-full px-6 py-2 font-bold hover:opacity-80" - on:click={() => goto("/login")} - > + on:click={() => goto("/login")}> {$t("nav.signIn")} </button> {/if} @@ -79,6 +81,8 @@ class="block md:hidden absolute top-[34.5px] right-10 z" on:click={() => (showMobileMenu = !showMobileMenu)} ><Icon icon={!showMobileMenu ? "menu" : "close"} /> + + </button> <div @@ -101,11 +105,12 @@ class="border rounded-full px-6 py-2 font-bold block w-full" on:click={() => goto("/register")} >{$t("nav.startInSeconds")} + + </button> <button class="bg-black text-white border rounded-full px-6 py-2 font-bold block w-full" - on:click={() => goto("/login")} - > + on:click={() => goto("/login")}> {$t("nav.signIn")} </button> {:else} @@ -113,11 +118,12 @@ class="border rounded-full px-6 py-2 font-bold block" on:click={() => goto(`/${user.username}`)} >{$t("nav.account")} + + </button> <button class="bg-black text-white border rounded-full px-6 py-2 font-bold block" - on:click={() => goto("/logout")} - > + on:click={() => goto("/logout")}> {$t("nav.signOut")} </button> {/if} diff --git a/src/components/LandingHero.svelte b/src/components/LandingHero.svelte index 43223499..14488cdd 100644 --- a/src/components/LandingHero.svelte +++ b/src/components/LandingHero.svelte @@ -29,8 +29,7 @@ <div class="flex justify-center"> <a href="/register"> <button - class="bg-black text-white border rounded-full px-6 py-2 font-bold hover:opacity-80" - > + class="bg-black text-white border rounded-full px-6 py-2 font-bold hover:opacity-80"> {$t("nav.startInSeconds")} </button> </a> diff --git a/src/components/Left.svelte b/src/components/Left.svelte index 1e236969..dd27a698 100644 --- a/src/components/Left.svelte +++ b/src/components/Left.svelte @@ -4,8 +4,7 @@ height="24" viewBox="0 0 24 24" fill="none" - xmlns="http://www.w3.org/2000/svg" -> + xmlns="http://www.w3.org/2000/svg"> <path d="M15 19L8 12L15 5" stroke="currentColor" diff --git a/src/components/Lnurlp.svelte b/src/components/Lnurlp.svelte index 6db7e7d7..d76d11c4 100644 --- a/src/components/Lnurlp.svelte +++ b/src/components/Lnurlp.svelte @@ -48,8 +48,7 @@ <div class="flex w-full"> <button type="submit" - class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24" - > + class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24"> {#if loading} <Spinner /> {:else} diff --git a/src/components/Lnurlw.svelte b/src/components/Lnurlw.svelte index b83e648f..c0898c7c 100644 --- a/src/components/Lnurlw.svelte +++ b/src/components/Lnurlw.svelte @@ -53,8 +53,7 @@ <div class="flex w-full"> <button type="submit" - class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24" - > + class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24"> {#if loading} <Spinner /> {:else} diff --git a/src/components/LocationsMap.svelte b/src/components/LocationsMap.svelte index b41b1a73..1f44ae34 100644 --- a/src/components/LocationsMap.svelte +++ b/src/components/LocationsMap.svelte @@ -225,8 +225,7 @@ <div class="flex absolute flex top-2 right-2 gap-2"> <button class="rounded-full border-2 border-black bg-white w-10 h-10" - on:click={toggle} - > + on:click={toggle}> {#if timeout} <Icon icon="pause" style="w-4 m-auto" /> {:else} @@ -235,8 +234,7 @@ </button> <button class="rounded-full border-2 border-black bg-white w-10 h-10" - on:click={full} - > + on:click={full}> <Icon icon="full" style="w-4 m-auto" /> </button> </div> diff --git a/src/components/Lock.svelte b/src/components/Lock.svelte index fce994a2..23ab0699 100644 --- a/src/components/Lock.svelte +++ b/src/components/Lock.svelte @@ -3,8 +3,7 @@ class="absolute bottom-0 left-0 -mb-0.5 transform translate-x-1/2 -translate-y-1/2 text-black peer-placeholder-shown:text-gray-300 h-6 w-6" fill="none" viewBox="0 0 24 24" - stroke="currentColor" -> + stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" diff --git a/src/components/Numpad.svelte b/src/components/Numpad.svelte index c758bf77..4dd73f6d 100644 --- a/src/components/Numpad.svelte +++ b/src/components/Numpad.svelte @@ -220,8 +220,7 @@ <button type="button" class="bg-primary rounded-xl py-4 px-8 font-semibold active:bg-black active:text-white flex justify-center items-center hover:opacity-80" - on:click={() => handleInput(value)} - > + on:click={() => handleInput(value)}> <Left /> </button> {:else} diff --git a/src/components/Password.svelte b/src/components/Password.svelte index da65d718..ab8b9449 100644 --- a/src/components/Password.svelte +++ b/src/components/Password.svelte @@ -57,8 +57,7 @@ <button type="button" on:click={() => (revealPassword = !revealPassword)} - class="absolute right-5 top-6" - > + class="absolute right-5 top-6"> <Icon icon={revealPassword ? "eye" : "eye-off"} /> </button> </div> @@ -67,14 +66,12 @@ 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} - > + 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" - > + 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> diff --git a/src/components/Pin.svelte b/src/components/Pin.svelte index 9938f9a1..50b0e463 100644 --- a/src/components/Pin.svelte +++ b/src/components/Pin.svelte @@ -53,8 +53,7 @@ <div class="w-full flex"> <button class="border-2 border-black rounded-xl font-semibold mx-auto py-3 w-40 hover:opacity-80 mx-auto" - on:click|preventDefault={cancel} - > + on:click|preventDefault={cancel}> <div class="my-auto">Cancel</div> </button> </div> diff --git a/src/components/Pinpad.svelte b/src/components/Pinpad.svelte index 641ddb2b..1a549654 100644 --- a/src/components/Pinpad.svelte +++ b/src/components/Pinpad.svelte @@ -60,8 +60,7 @@ <button type="button" on:click={() => (hide = !hide)} - class="absolute -right-5 top-5" - > + class="absolute -right-5 top-5"> <Icon icon={hide ? "eye-off" : "eye"} style="w-8" /> </button> </div> @@ -72,8 +71,7 @@ <button type="button" class="bg-primary rounded-xl py-4 px-8 font-semibold active:bg-black active:text-white flex justify-center items-center hover:opacity-80" - on:click={() => handleInput(value)} - > + on:click={() => handleInput(value)}> <Left /> </button> {:else} diff --git a/src/components/RegisterOrLogin.svelte b/src/components/RegisterOrLogin.svelte deleted file mode 100644 index be7d4142..00000000 --- a/src/components/RegisterOrLogin.svelte +++ /dev/null @@ -1,193 +0,0 @@ -<script> - import { applyAction, deserialize } from "$app/forms"; - import { tick } from "svelte"; - import { fly } from "svelte/transition"; - import { enhance } from "$app/forms"; - import Pin from "$comp/Pin.svelte"; - import Icon from "$comp/Icon.svelte"; - import Spinner from "$comp/Spinner.svelte"; - import { focus, fail } from "$lib/utils"; - import { password, loginRedirect } from "$lib/store"; - import { t } from "$lib/translations"; - import { page } from "$app/stores"; - import { generate } from "$lib/nostr"; - import { invalidateAll } from "$app/navigation"; - - export let form; - export let pageID; - - let token, formElement; - let code = []; - let redirect; - - $password = undefined; - - $: need2fa = form?.message === "2fa"; - let cancel = () => (need2fa = false); - $: if (form?.message === "2fa" && form.token === token) token = ""; - - let username, email, btn; - - $: update(form); - let update = (form) => form && ({ username, password: $password } = form); - - $: token && token?.length === 6 && tick().then(() => btn.click()); - - let revealPassword = false; - - let action = { - register: "/register", - signIn: "/login", - }[pageID]; - - let loading; - async function handleSubmit(e) { - loading = true; - - let data = new FormData(this); - let user = Object.fromEntries(data); - await generate(user); - - for (let k in user) { - data.set(k, user[k]); - } - - const response = await fetch(action, { - method: "POST", - body: data, - }); - - const result = deserialize(await response.text()); - - if (result.type === "success") { - await invalidateAll(); - } - - applyAction(result); - loading = false; - } -</script> - -{#if need2fa} - <Pin bind:value={token} title="Enter 2FA Code" {cancel} notify={false} /> -{/if} - -<div class="pt-10"> - <div class="w-[243px] mx-auto mb-10"> - <a href="/"> - <Icon icon="logo" /> - </a> - </div> - - <div class="flex justify-center items-center"> - <div - class="shadow-xl rounded-3xl p-10 pb-12 space-y-5 w-full mx-5 md:mx-0 md:w-[400px]" - > - <h1 class="text-2xl font-bold text-center">{$t("login." + pageID)}</h1> - - {#if form?.error} - <div class="text-red-600 text-center" in:fly> - {form.error} - </div> - {/if} - - <form - class="space-y-5" - on:submit|preventDefault={handleSubmit} - method="POST" - > - <input - type="hidden" - name="loginRedirect" - value={$loginRedirect || $page.url.searchParams.get("redirect")} - /> - <input type="hidden" name="token" value={token} /> - - <div> - <label for="username" class="font-semibold" - >{$t("login.username")}</label - > - <input - name="username" - type="text" - required - class="bg-primary" - bind:value={username} - use:focus - autocapitalize="none" - /> - </div> - - <div class="relative"> - <label for="password" class="block font-semibold" - >{$t("login.password")}</label - > - {#if revealPassword} - <input - name="password" - type="text" - required - class="bg-primary" - bind:value={$password} - autocapitalize="none" - /> - {:else} - <input - name="password" - type="password" - required - class="bg-primary" - bind:value={$password} - autocapitalize="none" - /> - {/if} - <button - type="button" - on:click={() => (revealPassword = !revealPassword)} - class="absolute right-5 top-10" - > - <Icon icon={revealPassword ? "eye" : "eye-off"} /> - </button> - </div> - - {#if pageID === "register"} - <p class="text-secondary text-sm"> - {$t("login.passwordRecommendation")} - </p> - {:else} - <!-- TODO --> - <!-- <div class="flex justify-end items-center"> --> - <!-- <a href="/forgot" class="underline underline-offset-4 text-black text-sm" --> - <!-- >{$t('login.forgotUserOrPassword')}</a --> - <!-- > --> - <!-- </div> --> - {/if} - - <button - type="submit" - class="bg-black text-white w-full rounded-2xl p-4 font-semibold hover:opacity-80" - disabled={loading} - bind:this={btn} - > - {#if loading} - <Spinner /> - {:else} - {$t("login." + pageID)} - {/if} - </button> - </form> - - <p class="text-secondary text-center font-medium"> - {pageID === "register" - ? $t("login.haveAccount") - : $t("login.noAccount")} - <a - href={pageID === "register" ? "/login" : "/register"} - class="block md:inline text-black underline underline-offset-4 hover:opacity-80" - > - {pageID === "register" ? $t("login.signIn") : $t("login.register")} - </a> - </p> - </div> - </div> -</div> diff --git a/src/components/Request.svelte b/src/components/Request.svelte index c085f9e2..03364052 100644 --- a/src/components/Request.svelte +++ b/src/components/Request.svelte @@ -28,8 +28,7 @@ <div class="mx-auto my-auto flex gap-2"> <a href={`/${user.username}/receive/${$request.id}`}> <button - class="rounded-full border py-2 px-4 font-bold hover:opacity-80 w-32" - > + class="rounded-full border py-2 px-4 font-bold hover:opacity-80 w-32"> {$t("payments.invoice")} </button> </a> diff --git a/src/components/Spinner.svelte b/src/components/Spinner.svelte index e9c3348f..2e9243b9 100644 --- a/src/components/Spinner.svelte +++ b/src/components/Spinner.svelte @@ -2,8 +2,7 @@ class="mx-auto h-6 w-6 animate-spin text-white" xmlns="http://www.w3.org/2000/svg" fill="none" - viewBox="0 0 24 24" -> + viewBox="0 0 24 24"> <circle class="opacity-25" cx="12" diff --git a/src/components/index.js b/src/components/index.js deleted file mode 100644 index e69de29b..00000000 --- a/src/components/index.js +++ /dev/null |
