diff options
| author | Adam Soltys <[email protected]> | 2026-02-11 20:10:43 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-02-11 20:10:43 -0800 |
| commit | 56a04684c1fb77ea7b21afc6b0d2e1c4773906f6 (patch) | |
| tree | d6bc2557c56b93177bb14aa376847c6e123a4862 /src/components | |
| parent | 13466248004327e9a026cb89f94926f9b060d1c1 (diff) | |
| download | coinos-ui-56a04684c1fb77ea7b21afc6b0d2e1c4773906f6.tar.gz coinos-ui-56a04684c1fb77ea7b21afc6b0d2e1c4773906f6.zip | |
format
Diffstat (limited to 'src/components')
43 files changed, 176 insertions, 633 deletions
diff --git a/src/components/404.svelte b/src/components/404.svelte index d5fdfa38..5a7ba663 100644 --- a/src/components/404.svelte +++ b/src/components/404.svelte @@ -5,12 +5,10 @@ <div class="flex justify-center items-center mt-20"> <div class="space-y-5 text-center"> <a href="/"> - <iconify-icon noobserver icon="coinos:logo" width="224" class="mx-auto" - ></iconify-icon> + <iconify-icon noobserver icon="coinos:logo" width="224" class="mx-auto"></iconify-icon> </a> - <iconify-icon noobserver icon="ph:question-bold" class="mx-auto w-56" - ></iconify-icon> + <iconify-icon noobserver icon="ph:question-bold" class="mx-auto w-56"></iconify-icon> <h1 class="font-bold text-5xl">{$t("404.404")}</h1> <p>{$t("404.pageNotFound")}</p> diff --git a/src/components/About.svelte b/src/components/About.svelte index 0c8be717..dbcf7854 100644 --- a/src/components/About.svelte +++ b/src/components/About.svelte @@ -33,10 +33,7 @@ <div class="flex w-full"> <div class="md:flex 2xl:items-start md:max-w-2xl mx-auto"> <div class="w-[220px] mx-auto"> - <Image - image={member.name} - style="rounded-full mx-auto w-40 h-40 mb-5 object-cover" - /> + <Image image={member.name} style="rounded-full mx-auto w-40 h-40 mb-5 object-cover" /> <div class="space-y-2"> <span class="text-2xl text-center font-semibold block" @@ -69,9 +66,7 @@ <h3 class="text-5xl font-medium mb-5 text-center"> {$t("about.locations.header")} </h3> - <p - class="text-secondary text-xl w-full md:w-10/12 lg:w-2/3 2xl:w-[800px] mx-auto mb-10" - > + <p class="text-secondary text-xl w-full md:w-10/12 lg:w-2/3 2xl:w-[800px] mx-auto mb-10"> {@html $t("about.locations.description")} </p> diff --git a/src/components/Account.svelte b/src/components/Account.svelte index c88c1118..88b944b3 100644 --- a/src/components/Account.svelte +++ b/src/components/Account.svelte @@ -9,21 +9,10 @@ import { t } from "$lib/translations"; import { versions } from "$lib/utils"; import { arkkey } from "$lib/ark"; - import { - getRememberedWalletPassword, - forgetWalletPassword, - } from "$lib/passwordCache"; + import { getRememberedWalletPassword, forgetWalletPassword } from "$lib/passwordCache"; let { user, rate, account }: any = $props(); - let { - name, - seed, - fingerprint, - balance, - id, - type: accountType, - arkAddress, - } = $derived(account); + let { name, seed, fingerprint, balance, id, type: accountType, arkAddress } = $derived(account); let arkBalance = $state(0); let arkLoading = $state(false); @@ -45,12 +34,11 @@ $arkkey = hex.encode(decrypt(seed, cached) as Uint8Array); } else if (user.seed) { // Master seed: derive m/86'/0'/0'/0/0 - const [{ HDKey }, { entropyToMnemonic, mnemonicToSeed }, { wordlist }] = - await Promise.all([ - import("@scure/bip32"), - import("@scure/bip39"), - import("@scure/bip39/wordlists/english.js"), - ]); + const [{ HDKey }, { entropyToMnemonic, mnemonicToSeed }, { wordlist }] = await Promise.all([ + import("@scure/bip32"), + import("@scure/bip39"), + import("@scure/bip39/wordlists/english.js"), + ]); let entropy = await decrypt(user.seed, cached); let mnemonic = entropyToMnemonic(entropy, wordlist); let s = await mnemonicToSeed(mnemonic, cached); @@ -91,12 +79,11 @@ if (seed) { $arkkey = hex.encode(decrypt(seed, password!) as Uint8Array); } else if (user.seed) { - const [{ HDKey }, { entropyToMnemonic, mnemonicToSeed }, { wordlist }] = - await Promise.all([ - import("@scure/bip32"), - import("@scure/bip39"), - import("@scure/bip39/wordlists/english.js"), - ]); + const [{ HDKey }, { entropyToMnemonic, mnemonicToSeed }, { wordlist }] = await Promise.all([ + import("@scure/bip32"), + import("@scure/bip39"), + import("@scure/bip39/wordlists/english.js"), + ]); let entropy = await decrypt(user.seed, password!); let mnemonic = entropyToMnemonic(entropy, wordlist); let s = await mnemonicToSeed(mnemonic, password!); @@ -153,14 +140,9 @@ onclick={goSettings} > {#if isArk} - <img - src="/images/ark.png" - class="w-8 h-8 rounded-full object-cover" - alt="Ark" - /> + <img src="/images/ark.png" class="w-8 h-8 rounded-full object-cover" alt="Ark" /> {:else if seed || (user.seed && fingerprint)} - <iconify-icon noobserver icon="cryptocurrency-color:btc" width="32" - ></iconify-icon> + <iconify-icon noobserver icon="cryptocurrency-color:btc" width="32"></iconify-icon> {:else} <img src="/images/icon.png" class="w-8 h-8" /> {/if} @@ -169,20 +151,9 @@ </div> <div class="flex w-full text-xl gap-2"> - <a - href={"/invoice"} - class="contents" - onclick={(e) => setAccount(e, "/invoice")} - > - <button - class="btn !w-auto flex-1 !bg-base-300" - data-testid="account-receive" - > - <iconify-icon - noobserver - icon="ph:hand-coins-bold" - width="32" - flip="horizontal" + <a href={"/invoice"} class="contents" onclick={(e) => setAccount(e, "/invoice")}> + <button class="btn !w-auto flex-1 !bg-base-300" data-testid="account-receive"> + <iconify-icon noobserver icon="ph:hand-coins-bold" width="32" flip="horizontal" ></iconify-icon> <div class="my-auto hidden sm:block"> {$t("user.dashboard.receive")} @@ -192,8 +163,7 @@ <a href={`/send`} class="contents" onclick={(e) => setAccount(e, "/send")}> <button type="button" class="btn !w-auto flex-1 !bg-base-300"> - <iconify-icon noobserver icon="ph:paper-plane-right-bold" width="32" - ></iconify-icon> + <iconify-icon noobserver icon="ph:paper-plane-right-bold" width="32"></iconify-icon> <div class="my-auto hidden sm:block">{$t("user.dashboard.send")}</div> </button> </a> diff --git a/src/components/Amount.svelte b/src/components/Amount.svelte index 8cfb9942..f368e96c 100644 --- a/src/components/Amount.svelte +++ b/src/components/Amount.svelte @@ -34,8 +34,7 @@ aria-label="Toggle currency display" > {#if !canShowFiat} - <iconify-icon noobserver {icon} class="text-yellow-300" - ></iconify-icon> + <iconify-icon noobserver {icon} class="text-yellow-300"></iconify-icon> {/if} {#if canShowFiat} {f(toFiat(amount, rate), currency, locale)} diff --git a/src/components/AmountField.svelte b/src/components/AmountField.svelte index 21c36631..b5c4261e 100644 --- a/src/components/AmountField.svelte +++ b/src/components/AmountField.svelte @@ -38,13 +38,10 @@ <button type="button" class="flex w-full" onclick={startSetting}> <div class="p-4 border rounded-2xl rounded-r-none border-r-0 bg-base-200"> - <iconify-icon noobserver icon="ph:lightning-fill" class="text-yellow-300" - ></iconify-icon> + <iconify-icon noobserver icon="ph:lightning-fill" class="text-yellow-300"></iconify-icon> </div> - <div - class="border-l-0 rounded-l-none pl-2 w-full p-4 border rounded-2xl text-left" - > + <div class="border-l-0 rounded-l-none pl-2 w-full p-4 border rounded-2xl text-left"> {amount || none} </div> <input type="hidden" {name} bind:value={amount} /> @@ -52,24 +49,14 @@ </div> {#if setting} - <div - class="fixed bg-base-100/90 inset-0 overflow-y-auto h-full w-full z-50 max-w-lg mx-auto" - > + <div class="fixed bg-base-100/90 inset-0 overflow-y-auto h-full w-full z-50 max-w-lg mx-auto"> <div class="relative p-5 border shadow-lg rounded-md bg-base-100 space-y-5"> <h1 class="text-center text-2xl font-semibold"> {label} </h1> - <Numpad - bind:amount - {currency} - {rate} - bind:submit={done} - bind:element={numpad} - /> + <Numpad bind:amount {currency} {rate} bind:submit={done} bind:element={numpad} /> - <button bind:this={done} type="button" onclick={set} class="btn" - >Ok</button - > + <button bind:this={done} type="button" onclick={set} class="btn">Ok</button> </div> </div> {/if} diff --git a/src/components/AppForm.svelte b/src/components/AppForm.svelte index 2f65372c..2fedca47 100644 --- a/src/components/AppForm.svelte +++ b/src/components/AppForm.svelte @@ -16,17 +16,7 @@ PUBLIC_COINOS_RELAY as relayUrl, } from "$env/static/public"; - let { - rate, - user, - name, - max_fee, - max_amount, - budget_renewal, - pubkey, - secret, - notify, - } = $props(); + let { rate, user, name, max_fee, max_amount, budget_renewal, pubkey, secret, notify } = $props(); let { currency } = $derived(user); onMount(() => { @@ -95,9 +85,7 @@ /> <div> - <label for="name" class="font-bold mb-1 block" - >{$t("accounts.renewal")}</label - > + <label for="name" class="font-bold mb-1 block">{$t("accounts.renewal")}</label> <select name="budget_renewal" bind:value={budget_renewal}> <option value="never" selected>{$t("accounts.never")}</option> <option value="daily">{$t("accounts.daily")}</option> @@ -108,9 +96,7 @@ </div> <div> - <label for="notify" class="font-bold mb-1 block" - >{$t("accounts.notifications")}</label - > + <label for="notify" class="font-bold mb-1 block">{$t("accounts.notifications")}</label> <select name="notify" bind:value={notify}> <option value={false} selected>{$t("accounts.off")}</option> <option value={true}>{$t("accounts.on")}</option> @@ -118,16 +104,9 @@ </div> <div> - <label for="pubkey" class="font-bold mb-1 block" - >{$t("accounts.pubkey")}</label - > + <label for="pubkey" class="font-bold mb-1 block">{$t("accounts.pubkey")}</label> <div class="flex gap-1 items-center"> - <textarea - rows={3} - name="pubkey" - bind:value={pubkey} - class="grow" - readonly={secret} + <textarea rows={3} name="pubkey" bind:value={pubkey} class="grow" readonly={secret} ></textarea> <button type="button" @@ -142,29 +121,15 @@ {#if !pubkey || secret} <div> - <label for="secret" class="font-bold mb-1 block" - >{$t("accounts.secret")}</label - > + <label for="secret" class="font-bold mb-1 block">{$t("accounts.secret")}</label> <div class="flex gap-1 items-center"> - <textarea rows={3} name="secret" bind:value={secret} class="grow" - ></textarea> + <textarea rows={3} name="secret" bind:value={secret} class="grow"></textarea> <div class="space-y-2 w-24"> - <button - type="button" - onclick={generate} - class="btn" - aria-label="Generate secret" - > - <iconify-icon noobserver icon="ph:dice-three-bold" width="32" - ></iconify-icon> + <button type="button" onclick={generate} class="btn" aria-label="Generate secret"> + <iconify-icon noobserver icon="ph:dice-three-bold" width="32"></iconify-icon> </button> - <button - type="button" - onclick={() => copy(secret)} - class="btn" - aria-label="Copy secret" - > + <button type="button" onclick={() => copy(secret)} class="btn" aria-label="Copy secret"> <iconify-icon icon="ph:copy-bold" width="32"></iconify-icon> </button> </div> @@ -173,8 +138,7 @@ {/if} <div class="space-y-2"> - <button type="submit" class="btn btn-accent">{$t("payments.submit")}</button - > + <button type="submit" class="btn btn-accent">{$t("payments.submit")}</button> {#if pubkey} <button type="button" class="btn" onclick={del}> <iconify-icon icon="ph:trash-bold" width="32"></iconify-icon> diff --git a/src/components/AppHeader.svelte b/src/components/AppHeader.svelte index f45f4d0c..daeedcdb 100644 --- a/src/components/AppHeader.svelte +++ b/src/components/AppHeader.svelte @@ -56,9 +56,7 @@ ]); let opacity = $derived((href) => - $page.url.pathname === href - ? "opacity-100" - : "opacity-90 hover:opacity-none", + $page.url.pathname === href ? "opacity-100" : "opacity-90 hover:opacity-none", ); </script> @@ -74,8 +72,7 @@ {#each links as { href, icon, label }} <a {href} data-sveltekit-preload-code="eager" aria-label={label}> <button class="btn-menu {opacity(href)}" aria-label={label}> - <iconify-icon noobserver {icon} width={(w ?? 0) > 640 ? 32 : 24} - ></iconify-icon> + <iconify-icon noobserver {icon} width={(w ?? 0) > 640 ? 32 : 24}></iconify-icon> </button> </a> {/each} diff --git a/src/components/Avatar.svelte b/src/components/Avatar.svelte index c9bacf65..c56b7486 100644 --- a/src/components/Avatar.svelte +++ b/src/components/Avatar.svelte @@ -9,29 +9,16 @@ class?: string; } - let { - user, - size = 32, - disabled = false, - class: className = "", - }: Props = $props(); + let { user, size = 32, disabled = false, class: className = "" }: Props = $props(); let s = $derived(size.toString()); - let link = $derived( - user ? (user.anon ? `/${user.pubkey}` : `/${user.username}`) : undefined, - ); + let link = $derived(user ? (user.anon ? `/${user.pubkey}` : `/${user.username}`) : undefined); let base = "/api/public"; - let profile = $derived( - user?.profile ? `${base}/${user.profile}.webp` : user?.picture, - ); - let fallback = $derived( - `${base}/punks/` + punk(user?.pubkey || user?.id || "aa"), - ); + let profile = $derived(user?.profile ? `${base}/${user.profile}.webp` : user?.picture); + let fallback = $derived(`${base}/punks/` + punk(user?.pubkey || user?.id || "aa")); let tmp = $derived( - ($avatar as any)?.id && - ($avatar as any).id === user?.id && - ($avatar as any).src, + ($avatar as any)?.id && ($avatar as any).id === user?.id && ($avatar as any).src, ); let src = $derived(tmp || profile || fallback); </script> diff --git a/src/components/Balance.svelte b/src/components/Balance.svelte index 41b55c7a..440c260d 100644 --- a/src/components/Balance.svelte +++ b/src/components/Balance.svelte @@ -27,13 +27,8 @@ <div> {#if user.haspin && !$pin} - <button - onclick={toggleShow} - class="flex gap-2 text-xl" - data-testid="balance-show" - > - <iconify-icon noobserver icon="ph:eye-slash-bold" width="32" - ></iconify-icon> + <button onclick={toggleShow} class="flex gap-2 text-xl" data-testid="balance-show"> + <iconify-icon noobserver icon="ph:eye-slash-bold" width="32"></iconify-icon> <div class="my-auto">{$t("user.showBalance")}</div> </button> {:else if !isNaN(rate)} @@ -47,14 +42,7 @@ /> {#if locked && id === user.id} <div class="text-red-600"> - <Amount - amount={locked} - {rate} - {currency} - {locale} - align="left" - locked={true} - /> + <Amount amount={locked} {rate} {currency} {locale} align="left" locked={true} /> </div> {/if} </div> diff --git a/src/components/Code.svelte b/src/components/Code.svelte index 4f182ff2..48c132b0 100644 --- a/src/components/Code.svelte +++ b/src/components/Code.svelte @@ -5,12 +5,7 @@ </script> {#snippet cp(something)} - <button - type="button" - class="ml-auto" - onclick={() => copy(something)} - aria-label="Copy value" - > + <button type="button" class="ml-auto" onclick={() => copy(something)} aria-label="Copy value"> <iconify-icon noobserver icon="ph:copy-bold" width="42"></iconify-icon> </button> {/snippet} diff --git a/src/components/DarkToggle.svelte b/src/components/DarkToggle.svelte index ebeaf762..78506c88 100644 --- a/src/components/DarkToggle.svelte +++ b/src/components/DarkToggle.svelte @@ -7,10 +7,7 @@ }; </script> -<button - class="flex justify-center items-center hover:opacity-80 gap-2 font-bold" - onclick={dark} -> +<button class="flex justify-center items-center hover:opacity-80 gap-2 font-bold" onclick={dark}> <iconify-icon noobserver icon={$theme === "dark" ? "ph:sun-bold" : "ph:moon-stars-bold"} diff --git a/src/components/Event.svelte b/src/components/Event.svelte index 3ecf00fc..03b93695 100644 --- a/src/components/Event.svelte +++ b/src/components/Event.svelte @@ -43,11 +43,7 @@ </div> {#if author.lud16} <div class="flex items-center"> - <iconify-icon - noobserver - icon="ph:lightning-fill" - class="text-yellow-300" - ></iconify-icon> + <iconify-icon noobserver icon="ph:lightning-fill" class="text-yellow-300"></iconify-icon> {author.lud16} </div> {/if} @@ -75,8 +71,7 @@ {:else if type === "link"} <Media {value} {minimal} /> {:else if type.match(/^nostr:np(rofile|ub)$/)} - <a href={`/${value.pubkey}`} class="font-bold">@{names[value.pubkey]}</a - > + <a href={`/${value.pubkey}`} class="font-bold">@{names[value.pubkey]}</a> {/if} {/each} </div> @@ -99,11 +94,7 @@ <div class="justify-center flex"> <button type="button" onclick={zap} class="btn btn-accent items-center"> <div class="flex gap-1 items-center"> - <iconify-icon - noobserver - icon="ph:lightning-fill" - class="text-yellow-300" - width={32} + <iconify-icon noobserver icon="ph:lightning-fill" class="text-yellow-300" width={32} ></iconify-icon> <div>Zap</div> </div> diff --git a/src/components/Footer.svelte b/src/components/Footer.svelte index 92930300..5bf7b461 100644 --- a/src/components/Footer.svelte +++ b/src/components/Footer.svelte @@ -18,9 +18,7 @@ ]; </script> -<footer - class="space-y-10 md:space-y-0 text-xl block md:flex justify-around pb-8 px-4" -> +<footer class="space-y-10 md:space-y-0 text-xl block md:flex justify-around pb-8 px-4"> <div class="space-y-5"> <div class="text-center w-full"> <a href="/" aria-label="Home"> @@ -36,9 +34,7 @@ </a> </div> </div> - <div - class="w-full flex flex-wrap sm:flex-nowrap gap-2 justify-center items-center" - > + <div class="w-full flex flex-wrap sm:flex-nowrap gap-2 justify-center items-center"> <DarkToggle /> <LocaleSelector /> </div> @@ -49,11 +45,8 @@ <ul class="mt-5 text-secondary space-y-3 font-medium"> {#each followLinks as link} <li> - <a - href={link.url} - target="_blank" - rel="noreferrer" - class="hover:opacity-80">{$t("footer." + link.titleID)}</a + <a href={link.url} target="_blank" rel="noreferrer" class="hover:opacity-80" + >{$t("footer." + link.titleID)}</a > </li> {/each} @@ -65,18 +58,12 @@ <ul class="mt-5 text-secondary space-y-3"> {#each companyLinks as link} <li> - <a href={link.url} class="hover:opacity-80" - >{$t("footer." + link.titleID)}</a - > + <a href={link.url} class="hover:opacity-80">{$t("footer." + link.titleID)}</a> </li> {/each} </ul> </div> - <iconify-icon - noobserver - icon="coinos:shield" - class="flex justify-center" - width="96" + <iconify-icon noobserver icon="coinos:shield" class="flex justify-center" width="96" ></iconify-icon> </footer> diff --git a/src/components/HowItWorksCard.svelte b/src/components/HowItWorksCard.svelte index 1012af46..33a39e08 100644 --- a/src/components/HowItWorksCard.svelte +++ b/src/components/HowItWorksCard.svelte @@ -4,8 +4,7 @@ </script> <div class="space-y-5"> - <iconify-icon noobserver icon={image} class="mx-auto" width="128" - ></iconify-icon> + <iconify-icon noobserver icon={image} class="mx-auto" width="128"></iconify-icon> <p class="text-2xl font-medium">{$t("howItWorks." + stepID + ".header")}</p> <p class="text-secondary text-xl font-medium w-full md:w-2/3 mx-auto"> {$t("howItWorks." + stepID + ".description")} diff --git a/src/components/InvoiceActions.svelte b/src/components/InvoiceActions.svelte index 7cc62698..c6ae7249 100644 --- a/src/components/InvoiceActions.svelte +++ b/src/components/InvoiceActions.svelte @@ -48,23 +48,20 @@ <div class="flex flex-wrap gap-2 justify-around text-secondary w-full"> {#if user?.id === invoice?.user?.id} <button class="btn grow !w-auto" onclick={toggleAmount}> - <iconify-icon noobserver icon="ph:pencil-simple-bold" width="32" - ></iconify-icon> + <iconify-icon noobserver icon="ph:pencil-simple-bold" width="32"></iconify-icon> <div class="my-auto">{t("payments.setAmount")}</div> </button> {:else} <a href={link} class="block"> <button class="btn grow !w-auto"> - <iconify-icon noobserver icon="ph:arrow-square-out-bold" width="32" - ></iconify-icon> + <iconify-icon noobserver icon="ph:arrow-square-out-bold" width="32"></iconify-icon> <div class="my-auto">{t("payments.openLink")}</div> </button> </a> {/if} <button class="btn grow !w-auto" onclick={toggleMemo}> - <iconify-icon noobserver icon="ph:chat-centered-text-bold" width="32" - ></iconify-icon> + <iconify-icon noobserver icon="ph:chat-centered-text-bold" width="32"></iconify-icon> <div class="my-auto"> {t("invoice.setMemo")} </div> @@ -80,8 +77,7 @@ </button> <button class="btn grow !w-auto" onclick={() => goto("/receive")}> - <iconify-icon noobserver icon="ph:clipboard-text-bold" width="32" - ></iconify-icon> + <iconify-icon noobserver icon="ph:clipboard-text-bold" width="32"></iconify-icon> <div class="my-auto text-lg">{t("user.send.paste")}</div> </button> @@ -95,11 +91,9 @@ <div class="w-full flex justify-center gap-2 flex-wrap"> <button class="btn" onclick={() => (showQr = !showQr)}> {#if showQr} - <iconify-icon noobserver icon="ph:text-align-center-bold" width="32" - ></iconify-icon> + <iconify-icon noobserver icon="ph:text-align-center-bold" width="32"></iconify-icon> {:else} - <iconify-icon noobserver icon="ph:qr-code-bold" width="32" - ></iconify-icon> + <iconify-icon noobserver icon="ph:qr-code-bold" width="32"></iconify-icon> {/if} <div class="my-auto"> {showQr ? t("payments.showText") : t("payments.showQr")} @@ -120,14 +114,9 @@ setType(types.lightning); }} > - <div - class="bg-black rounded-full w-8 h-8 items-center justify-center flex" - > + <div class="bg-black rounded-full w-8 h-8 items-center justify-center flex"> <div class="m-auto"> - <iconify-icon - noobserver - icon="ph:lightning-fill" - class="text-yellow-300 text-2xl" + <iconify-icon noobserver icon="ph:lightning-fill" class="text-yellow-300 text-2xl" ></iconify-icon> </div> </div> diff --git a/src/components/InvoiceData.svelte b/src/components/InvoiceData.svelte index 51f7b396..142755f0 100644 --- a/src/components/InvoiceData.svelte +++ b/src/components/InvoiceData.svelte @@ -39,12 +39,7 @@ {#if invoice.type === types.liquid} <div class="flex justify-center p-4 shadow items-center gap-2"> - <iconify-icon - noobserver - icon="ph:warning-bold" - width="48" - class="text-warning" - ></iconify-icon> + <iconify-icon noobserver icon="ph:warning-bold" width="48" class="text-warning"></iconify-icon> <div> <div class="my-auto text-xl text-center text-secondary"> {t("payments.onlyLbtc")} diff --git a/src/components/InvoiceTypes.svelte b/src/components/InvoiceTypes.svelte index 9aa1330a..cfde1285 100644 --- a/src/components/InvoiceTypes.svelte +++ b/src/components/InvoiceTypes.svelte @@ -22,8 +22,7 @@ class="btn flex-nowrap !w-auto grow" class:bg-base-300={type === types.bitcoin && address_type === "bech32"} class:text-secondary={type === types.bitcoin && address_type === "bech32"} - class:hidden={activeOnly && - (type !== types.bitcoin || address_type !== "bech32")} + class:hidden={activeOnly && (type !== types.bitcoin || address_type !== "bech32")} onclick={() => (activeOnly ? toggleType() : setType(types.bitcoin))} > <img src="/images/bitcoin.svg" class="w-8" alt="Bitcoin" /> @@ -34,10 +33,8 @@ class="btn flex-nowrap !w-auto grow" class:bg-base-300={type === types.bitcoin && address_type === "bech32m"} class:text-secondary={type === types.bitcoin && address_type === "bech32m"} - class:hidden={activeOnly && - (type !== types.bitcoin || address_type !== "bech32m")} - onclick={() => - activeOnly ? toggleType() : setType(types.bitcoin, "bech32m")} + class:hidden={activeOnly && (type !== types.bitcoin || address_type !== "bech32m")} + onclick={() => (activeOnly ? toggleType() : setType(types.bitcoin, "bech32m"))} > <img src="/images/bitcoin.svg" class="w-8" alt="Bitcoin" /> <div class="my-auto text-lg">Taproot</div> @@ -47,10 +44,8 @@ class="btn flex-nowrap !w-auto grow" class:bg-base-300={type === types.bitcoin && address_type === "legacy"} class:text-secondary={type === types.bitcoin && address_type === "legacy"} - class:hidden={activeOnly && - (type !== types.bitcoin || address_type !== "legacy")} - onclick={() => - activeOnly ? toggleType() : setType(types.bitcoin, "legacy")} + class:hidden={activeOnly && (type !== types.bitcoin || address_type !== "legacy")} + onclick={() => (activeOnly ? toggleType() : setType(types.bitcoin, "legacy"))} > <img src="/images/bitcoin.svg" class="w-8" alt="Bitcoin" /> <div class="my-auto text-lg">Legacy</div> @@ -62,10 +57,8 @@ <div class="flex flex-wrap gap-2"> <button class="btn flex-nowrap !w-auto grow" - class:bg-base-300={type === types.lightning && - $page.url.pathname.includes("/receive")} - class:text-secondary={type === types.lightning && - $page.url.pathname.includes("/receive")} + class:bg-base-300={type === types.lightning && $page.url.pathname.includes("/receive")} + class:text-secondary={type === types.lightning && $page.url.pathname.includes("/receive")} class:hidden={activeOnly && (type !== types.lightning || !$page.url.pathname.includes("/receive"))} onclick={() => { @@ -77,14 +70,9 @@ } }} > - <div - class="bg-black rounded-full w-8 h-8 items-center justify-center flex" - > + <div class="bg-black rounded-full w-8 h-8 items-center justify-center flex"> <div class="m-auto"> - <iconify-icon - noobserver - icon="ph:lightning-fill" - class="text-yellow-300 text-2xl" + <iconify-icon noobserver icon="ph:lightning-fill" class="text-yellow-300 text-2xl" ></iconify-icon> </div> </div> @@ -97,14 +85,9 @@ class:hidden={activeOnly && type !== types.bolt12} onclick={() => (activeOnly ? toggleType() : setType(types.bolt12))} > - <div - class="bg-black rounded-full w-8 h-8 items-center justify-center flex" - > + <div class="bg-black rounded-full w-8 h-8 items-center justify-center flex"> <div class="m-auto"> - <iconify-icon - noobserver - icon="ph:lightning-fill" - class="text-yellow-300 text-2xl" + <iconify-icon noobserver icon="ph:lightning-fill" class="text-yellow-300 text-2xl" ></iconify-icon> </div> </div> @@ -113,10 +96,8 @@ <button class="btn flex-nowrap !w-auto grow" - class:bg-base-300={type === types.lightning && - !$page.url.pathname.includes("/receive")} - class:text-secondary={type === types.lightning && - !$page.url.pathname.includes("/receive")} + class:bg-base-300={type === types.lightning && !$page.url.pathname.includes("/receive")} + class:text-secondary={type === types.lightning && !$page.url.pathname.includes("/receive")} class:hidden={activeOnly && (type !== types.lightning || $page.url.pathname.includes("/receive"))} onclick={() => { @@ -128,14 +109,9 @@ } }} > - <div - class="bg-black rounded-full w-8 h-8 items-center justify-center flex" - > + <div class="bg-black rounded-full w-8 h-8 items-center justify-center flex"> <div class="m-auto"> - <iconify-icon - noobserver - icon="ph:lightning-fill" - class="text-yellow-300 text-2xl" + <iconify-icon noobserver icon="ph:lightning-fill" class="text-yellow-300 text-2xl" ></iconify-icon> </div> </div> diff --git a/src/components/ItemForm.svelte b/src/components/ItemForm.svelte index 7215a239..a64cb7ee 100644 --- a/src/components/ItemForm.svelte +++ b/src/components/ItemForm.svelte @@ -17,10 +17,7 @@ let src: string | undefined = $state(); let tooLarge: Record<string, boolean> = {}; - let handleFile = async ( - { target }: { target: EventTarget | null }, - type: string, - ) => { + let handleFile = async ({ target }: { target: EventTarget | null }, type: string) => { tooLarge[type] = false; file = (target as HTMLInputElement).files![0]; if (!file) return; @@ -42,9 +39,7 @@ if (src) { try { - let { hash } = JSON.parse( - (await upload(file, "item", progress)) as string, - ); + let { hash } = JSON.parse((await upload(file, "item", progress)) as string); data.set("image", hash); @@ -91,11 +86,7 @@ <div> <label for="price" class="font-bold mb-1 block">{$t("items.price")}</label> <div class="flex"> - <input - name="price" - bind:value={item.price} - class="border-r-none rounded-r-none" - /> + <input name="price" bind:value={item.price} class="border-r-none rounded-r-none" /> <div class="text-gray-600 rounded-r-2xl p-4 my-auto rounded-l-none rounded border bg-gray-100" > diff --git a/src/components/LandingHeader.svelte b/src/components/LandingHeader.svelte index f1b6a2b4..9d8b92cf 100644 --- a/src/components/LandingHeader.svelte +++ b/src/components/LandingHeader.svelte @@ -22,10 +22,7 @@ }; </script> -<header - class="w-full lg:w-5/6 p-4 mx-auto fixed sticky z-10 top-0 bg-base-100" - bind:this={header} -> +<header class="w-full lg:w-5/6 p-4 mx-auto fixed sticky z-10 top-0 bg-base-100" bind:this={header}> <nav class="block lg:flex justify-between items-center"> <div class="flex justify-start lg:justify-center items-center lg:space-x-5"> <a href="/" onclick={() => scroll(header)} aria-label="Home"> @@ -39,35 +36,21 @@ <button class="hover:opacity-80" onclick={() => scroll(howItWorks)} >{$t("howItWorks.header")}</button > - <button class="hover:opacity-80" onclick={() => scroll(faq)} - >{$t("faq.header")}</button - > - <button class="hover:opacity-80" onclick={() => scroll(about)} - >{$t("about.header")}</button - > + <button class="hover:opacity-80" onclick={() => scroll(faq)}>{$t("faq.header")}</button> + <button class="hover:opacity-80" onclick={() => scroll(about)}>{$t("about.header")}</button> {/if} {#if user} - <button - class="btn !w-auto !rounded-full" - onclick={() => goto(`/${user.username}`)} + <button class="btn !w-auto !rounded-full" onclick={() => goto(`/${user.username}`)} >{$t("nav.home")} </button> - <button - class="btn !w-auto !rounded-full" - onclick={() => goto("/logout")} - > + <button class="btn !w-auto !rounded-full" onclick={() => goto("/logout")}> {$t("nav.signOut")} </button> {:else} - <button - class="btn btn-accent !w-auto !rounded-full" - onclick={() => goto("/register")} + <button class="btn btn-accent !w-auto !rounded-full" onclick={() => goto("/register")} >{$t("nav.register")} </button> - <button - class="btn !w-auto !rounded-full" - onclick={() => goto("/login")} - > + <button class="btn !w-auto !rounded-full" onclick={() => goto("/login")}> {$t("nav.signIn")} </button> {/if} @@ -78,10 +61,7 @@ class="block lg:hidden absolute top-[34.5px] right-10 z" onclick={() => (showMobileMenu = !showMobileMenu)} > - <iconify-icon - noobserver - icon={!showMobileMenu ? "ph:list-bold" : "ph:x-bold"} - width="32" + <iconify-icon noobserver icon={!showMobileMenu ? "ph:list-bold" : "ph:x-bold"} width="32" ></iconify-icon> </button> @@ -96,9 +76,7 @@ <button onclick={() => mobileMenuButtonClick(howItWorks)} class="block" >{$t("howItWorks.header")}</button > - <button onclick={() => mobileMenuButtonClick(faq)} class="block" - >{$t("faq.header")}</button - > + <button onclick={() => mobileMenuButtonClick(faq)} class="block">{$t("faq.header")}</button> <button onclick={() => mobileMenuButtonClick(about)} class="block" >{$t("about.header")}</button > diff --git a/src/components/LandingInfoCard.svelte b/src/components/LandingInfoCard.svelte index cb16c5dd..8b85518c 100644 --- a/src/components/LandingInfoCard.svelte +++ b/src/components/LandingInfoCard.svelte @@ -1,13 +1,7 @@ <script lang="ts"> import Image from "./Image.svelte"; - let { - image, - title, - description = undefined, - order = undefined, - children, - } = $props(); + let { image, title, description = undefined, order = undefined, children } = $props(); </script> <div class="block lg:flex justify-center lg:space-x-20 items-center"> @@ -17,14 +11,10 @@ 'reverse' && 'order-last'}" /> <div class="w-full lg:w-1/2 max-w-3xl space-y-10 mx-auto lg:mx-0"> - <h3 - class="text-5xl font-medium text-left w-full mx-auto lg:mx-0 md:w-[500px]" - > + <h3 class="text-5xl font-medium text-left w-full mx-auto lg:mx-0 md:w-[500px]"> {title} </h3> - <p - class="text-secondary text-xl font-medium w-full md:w-[500px] mx-auto lg:mx-0" - > + <p class="text-secondary text-xl font-medium w-full md:w-[500px] mx-auto lg:mx-0"> {#if description} {description} {:else} diff --git a/src/components/Lnurlp.svelte b/src/components/Lnurlp.svelte index c735c5a8..360c05db 100644 --- a/src/components/Lnurlp.svelte +++ b/src/components/Lnurlp.svelte @@ -9,8 +9,7 @@ let { data, form, send = $bindable(), comment = $bindable() } = $props(); let { currency } = data.user; - let { minSendable, maxSendable, commentAllowed, callback, metadata, rate } = - data; + let { minSendable, maxSendable, commentAllowed, callback, metadata, rate } = data; let amount = $state(Math.round(minSendable / 1000)), loading = $state(); diff --git a/src/components/Lnurlw.svelte b/src/components/Lnurlw.svelte index 006fda8b..9b374fcd 100644 --- a/src/components/Lnurlw.svelte +++ b/src/components/Lnurlw.svelte @@ -11,14 +11,7 @@ let { data, form } = $props(); let { currency, username } = data.user; - let { - defaultDescription, - minWithdrawable, - maxWithdrawable, - k1, - callback, - rate, - } = data; + let { defaultDescription, minWithdrawable, maxWithdrawable, k1, callback, rate } = data; let amount = $state(Math.round(minWithdrawable / 1000)); let amountFiat = $derived(parseFloat(((amount * rate) / sats).toFixed(2))); @@ -56,9 +49,7 @@ <div>{f(amountFiat, currency)}</div> {:else} <div> - <span class="text-secondary font-normal text-xl" - >⚡️{`${s(amount)}`}</span - > + <span class="text-secondary font-normal text-xl">⚡️{`${s(amount)}`}</span> </div> {/if} </div> @@ -66,12 +57,7 @@ <Numpad bind:amount {currency} {rate} /> {/if} - <form - use:enhance={handler(toggle)} - action="?/withdraw" - method="POST" - class="space-y-5" - > + <form use:enhance={handler(toggle)} action="?/withdraw" method="POST" class="space-y-5"> <input name="amount" value={amount} type="hidden" /> <input name="username" value={username} type="hidden" /> <input name="currency" value={currency} type="hidden" /> @@ -89,22 +75,14 @@ disabled={submitting} onkeydown={setMax} >{#if $fiat} - Max {f( - (Math.floor(maxWithdrawable / 1000) * rate) / sats, - currency, - )} + Max {f((Math.floor(maxWithdrawable / 1000) * rate) / sats, currency)} {:else} Max ⚡️{s(Math.floor(maxWithdrawable / 1000))} {/if}</button > {/if} - <button - use:focus - bind:this={submit} - type="submit" - class="btn btn-accent !w-auto grow" - > + <button use:focus bind:this={submit} type="submit" class="btn btn-accent !w-auto grow"> {#if submitting} <Spinner /> {:else} diff --git a/src/components/LoadingSplash.svelte b/src/components/LoadingSplash.svelte index e629a494..8ed0429f 100644 --- a/src/components/LoadingSplash.svelte +++ b/src/components/LoadingSplash.svelte @@ -1,8 +1,4 @@ <div class="flex justify-center items-center"> - <iconify-icon - noobserver - icon="coinos:logo" - width="224" - class="mt-[calc(50vh-72px)]" + <iconify-icon noobserver icon="coinos:logo" width="224" class="mt-[calc(50vh-72px)]" ></iconify-icon> </div> diff --git a/src/components/LocationsMap.svelte b/src/components/LocationsMap.svelte index 3ec50e38..23da473e 100644 --- a/src/components/LocationsMap.svelte +++ b/src/components/LocationsMap.svelte @@ -181,11 +181,8 @@ maplibrePromise = new Promise((resolve, reject) => { const existing = document.querySelector("script[data-maplibre]"); if (existing) { - if ((window as any).maplibregl) - return resolve((window as any).maplibregl); - existing.addEventListener("load", () => - resolve((window as any).maplibregl), - ); + if ((window as any).maplibregl) return resolve((window as any).maplibregl); + existing.addEventListener("load", () => resolve((window as any).maplibregl)); existing.addEventListener("error", reject); return; } @@ -285,27 +282,20 @@ onDestroy(() => map && map.remove()); let list = $derived( search - ? markers.filter((m) => - m.tags.name.toLowerCase().includes(search.toLowerCase()), - ) + ? markers.filter((m) => m.tags.name.toLowerCase().includes(search.toLowerCase())) : inview, ); </script> <div class="w-screen h-dvh flex" id="map" bind:this={mapWrapper}> - <div - id="map-container" - class="mx-auto h-full w-full z-0" - bind:this={mapContainer} - ></div> + <div id="map-container" class="mx-auto h-full w-full z-0" bind:this={mapContainer}></div> <div class="absolute flex top-2 left-2 gap-2"> <button aria-label="Back" class="rounded-full border-2 border-black bg-base-100/80 w-16 h-16 flex items-center justify-center" onclick={back} > - <iconify-icon noobserver icon="ph:arrow-left-bold" width="24" - ></iconify-icon> + <iconify-icon noobserver icon="ph:arrow-left-bold" width="24"></iconify-icon> </button> </div> <div class="relative"> @@ -318,12 +308,10 @@ <div class="flex gap-1 absolute right-6 top-3"> {#if search} <button type="button" onclick={clearSearch} aria-label="Clear"> - <iconify-icon noobserver icon="ph:x-bold" width="32" - ></iconify-icon> + <iconify-icon noobserver icon="ph:x-bold" width="32"></iconify-icon> </button> {:else} - <iconify-icon noobserver icon="ph:search-bold" width="32" - ></iconify-icon> + <iconify-icon noobserver icon="ph:search-bold" width="32"></iconify-icon> {/if} </div> </div> @@ -354,11 +342,9 @@ aria-label={timeout ? "Resume map" : "Pause map"} > {#if timeout} - <iconify-icon noobserver icon="ph:pause-bold" width="24" - ></iconify-icon> + <iconify-icon noobserver icon="ph:pause-bold" width="24"></iconify-icon> {:else} - <iconify-icon noobserver icon="ph:play-bold" width="24" - ></iconify-icon> + <iconify-icon noobserver icon="ph:play-bold" width="24"></iconify-icon> {/if} </button> </div> diff --git a/src/components/Media.svelte b/src/components/Media.svelte index 9c2c21f8..6471d190 100644 --- a/src/components/Media.svelte +++ b/src/components/Media.svelte @@ -1,8 +1,6 @@ <script lang="ts"> - export const isImage = (url: string) => - url?.match(/^.*\.(jpg|jpeg|png|webp|gif|avif|svg)/gi); - export const isVideo = (url: string) => - url?.match(/^.*\.(mov|mkv|mp4|avi|m4v|webm)/gi); + export const isImage = (url: string) => url?.match(/^.*\.(jpg|jpeg|png|webp|gif|avif|svg)/gi); + export const isVideo = (url: string) => url?.match(/^.*\.(mov|mkv|mp4|avi|m4v|webm)/gi); export const isAudio = (url: string) => url?.match(/^.*\.(ogg|mp3|wav)/gi); // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/src/components/Menu.svelte b/src/components/Menu.svelte index 9b49a263..1c09bd54 100644 --- a/src/components/Menu.svelte +++ b/src/components/Menu.svelte @@ -27,13 +27,8 @@ <div> <OutClick onOutClick={hideMenu}> - <button - class="btn-menu {opacity('/support')}" - onclick={toggleMenu} - aria-label="Open menu" - > - <iconify-icon noobserver icon="ph:list-bold" width={w > 640 ? 32 : 24} - ></iconify-icon> + <button class="btn-menu {opacity('/support')}" onclick={toggleMenu} aria-label="Open menu"> + <iconify-icon noobserver icon="ph:list-bold" width={w > 640 ? 32 : 24}></iconify-icon> </button> <div @@ -66,8 +61,7 @@ </ul> <hr class="my-4" /> <a href="/?stay=true" aria-label="Coinos home" - ><iconify-icon noobserver icon="coinos:logo" width="160" - ></iconify-icon></a + ><iconify-icon noobserver icon="coinos:logo" width="160"></iconify-icon></a > </div> </OutClick> diff --git a/src/components/Nostr.svelte b/src/components/Nostr.svelte index 74e85faf..529dd6e7 100644 --- a/src/components/Nostr.svelte +++ b/src/components/Nostr.svelte @@ -32,8 +32,7 @@ let connectUrl: string | undefined = $state(); let nostrConnect = async () => { const { Relay } = await import("nostr-tools/relay"); - const { nip04, generateSecretKey, getPublicKey } = - await import("nostr-tools"); + const { nip04, generateSecretKey, getPublicKey } = await import("nostr-tools"); const { getConversationKey, decrypt } = await import("nostr-tools/nip44"); let connectionSecret = crypto.randomUUID(); @@ -49,9 +48,7 @@ try { let result; try { - ({ result } = JSON.parse( - await nip04.decrypt(sk, pk, event.content), - )); + ({ result } = JSON.parse(await nip04.decrypt(sk, pk, event.content))); } catch (e) { let ck = await getConversationKey(sk, pk); ({ result } = JSON.parse(await decrypt(event.content, ck))); @@ -119,9 +116,7 @@ {#if $eventToSign && !$signer?.ready} <div class="fixed inset-0 bg-base-100/90 overflow-y-auto h-full w-full z-50"> - <div - class="relative mx-auto mt-10 p-5 border w-96 shadow-lg rounded-md bg-base-100 space-y-5" - > + <div class="relative mx-auto mt-10 p-5 border w-96 shadow-lg rounded-md bg-base-100 space-y-5"> <h1 class="text-center text-2xl font-semibold">Nostr sign</h1> {#if ($eventToSign as any).sig && !hadSigner} @@ -140,16 +135,11 @@ </div> </a> <a href={connectUrl} class="btn"> - <iconify-icon - noobserver - icon="ph:arrow-square-out-bold" - width="32" - ></iconify-icon> + <iconify-icon noobserver icon="ph:arrow-square-out-bold" width="32"></iconify-icon> {$t("payments.openLink")}</a > <button class="btn" onclick={() => copy(connectUrl!)}> - <iconify-icon noobserver icon="ph:copy-bold" width="32" - ></iconify-icon> + <iconify-icon noobserver icon="ph:copy-bold" width="32"></iconify-icon> {$t("payments.copy")}</button > </div> @@ -157,8 +147,7 @@ {#if $signer?.method === "nsec"} <input bind:value={nsec} placeholder="nsec..." /> <button type="button" class="btn btn-accent" onclick={nsecSign}> - <iconify-icon icon="ph:paper-plane-right-bold" width="32" - ></iconify-icon> + <iconify-icon icon="ph:paper-plane-right-bold" width="32"></iconify-icon> <div class="my-auto">Submit</div> </button> {/if} @@ -166,10 +155,7 @@ {#if !$signer} {#if extensionAvailable} <button type="button" class="btn" onclick={extensionSign}> - <iconify-icon - icon="lucide-lab:bee" - width="32" - class="text-yellow-400" + <iconify-icon icon="lucide-lab:bee" width="32" class="text-yellow-400" ></iconify-icon> <div class="my-auto">Browser extension</div> </button> diff --git a/src/components/Numpad.svelte b/src/components/Numpad.svelte index 57e8dd24..4f04fbaa 100644 --- a/src/components/Numpad.svelte +++ b/src/components/Numpad.svelte @@ -29,8 +29,7 @@ function getCurrencyInfo(locale: any = "en-US", currency: string) { const l = typeof locale === "function" ? locale() : locale || "en-US"; const region = l.length >= 2 ? l.slice(-2) : ""; - const currencyDisplay = - region && currency.startsWith(region) ? "narrowSymbol" : "symbol"; + const currencyDisplay = region && currency.startsWith(region) ? "narrowSymbol" : "symbol"; const formatter = new Intl.NumberFormat(l, { style: "currency", currency, @@ -75,11 +74,8 @@ const updateByMode = () => { if (fiat) { - const numericFiat = - parseFloat((fiatDigits || "0").replace(/\D/g, "")) / 100; - amountFiat = isFinite(numericFiat) - ? numericFiat.toFixed(2) - : ("0.00" as any); + const numericFiat = parseFloat((fiatDigits || "0").replace(/\D/g, "")) / 100; + amountFiat = isFinite(numericFiat) ? numericFiat.toFixed(2) : ("0.00" as any); amount = numericFiat ? Math.round((numericFiat * sats) / rate) : 0; } else { // integer-only sats, already normalized @@ -201,8 +197,7 @@ if (!html) html = fiat ? formatFiatFromDigits("0", decimalChar) : "0"; }; - const keydown = (e) => - e.key === "Enter" && (e.preventDefault() || submit?.click?.()); + const keydown = (e) => e.key === "Enter" && (e.preventDefault() || submit?.click?.()); // CHANGED: make swap set html for the new mode immediately and keep DOM in sync const swap = () => { @@ -213,9 +208,7 @@ element && (element.innerHTML = html); } else { // going -> fiat - const cents = Math.round( - (parseFloat(String(amountFiat) || "0") || 0) * 100, - ); + const cents = Math.round((parseFloat(String(amountFiat) || "0") || 0) * 100); fiatDigits = Math.max(0, cents).toString(); fiat = true; html = formatFiatFromDigits(fiatDigits, decimalChar); @@ -241,27 +234,12 @@ }; const arrow = "<"; - const numPad = [ - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "00", - "0", - arrow, - ]; + const numPad = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "00", "0", arrow]; onMount(() => { fiat = $fiatStore; if (fiat) { - const cents = Math.round( - (parseFloat(String(amountFiat) || "0") || 0) * 100, - ); + const cents = Math.round((parseFloat(String(amountFiat) || "0") || 0) * 100); fiatDigits = Math.max(0, cents).toString(); html = formatFiatFromDigits(fiatDigits, decimalChar); // keep html in sync on mount } else { @@ -275,17 +253,12 @@ <div class="flex justify-center items-center"> <div class="space-y-5 w-full"> <div class="text-center"> - <div - class="text-5xl md:text-6xl font-semibold tracking-widest flex justify-center" - > + <div class="text-5xl md:text-6xl font-semibold tracking-widest flex justify-center"> <div class="my-auto" class:text-5xl={!fiat}> {#if fiat} {#if position === "before"}{symbol}{/if} {:else} - <iconify-icon - noobserver - icon="ph:lightning-fill" - class="text-yellow-300" + <iconify-icon noobserver icon="ph:lightning-fill" class="text-yellow-300" ></iconify-icon> {/if} </div> @@ -330,11 +303,7 @@ }} > {#if fiat} - <iconify-icon - noobserver - icon="ph:lightning-fill" - class="text-yellow-300" - ></iconify-icon> + <iconify-icon noobserver icon="ph:lightning-fill" class="text-yellow-300"></iconify-icon> {s(amount, locale)} {:else} {f(amountFiat, currency, locale)} diff --git a/src/components/Password.svelte b/src/components/Password.svelte index 2c2319f6..3a7d71fe 100644 --- a/src/components/Password.svelte +++ b/src/components/Password.svelte @@ -24,24 +24,17 @@ </script> <div class="fixed inset-0 bg-base-100/90 overflow-y-auto h-full w-full z-50"> - <div - class="relative top-1/3 mx-auto p-5 border w-96 shadow-lg rounded-md bg-base-100 space-y-5" - > + <div class="relative top-1/3 mx-auto p-5 border w-96 shadow-lg rounded-md bg-base-100 space-y-5"> <h1 class="text-center text-2xl font-semibold"> {$t("user.settings.pleaseEnterYourPassword")} </h1> <form onsubmit={submit} class="space-y-2"> <PasswordInput bind:value={password} {focus} /> <div class="w-full flex gap-2"> - <button - type="button" - class="btn !w-auto grow" - onclick={cancel} - onkeydown={cancel}>{$t("payments.cancel")}</button - > - <button type="submit" class="btn btn-accent !w-auto grow" - >{$t("payments.submit")}</button + <button type="button" class="btn !w-auto grow" onclick={cancel} onkeydown={cancel} + >{$t("payments.cancel")}</button > + <button type="submit" class="btn btn-accent !w-auto grow">{$t("payments.submit")}</button> </div> </form> </div> diff --git a/src/components/PasswordInput.svelte b/src/components/PasswordInput.svelte index 3f784290..8d16aad6 100644 --- a/src/components/PasswordInput.svelte +++ b/src/components/PasswordInput.svelte @@ -15,21 +15,11 @@ let icon = $derived(show ? "ph:eye-bold" : "ph:eye-slash-bold"); </script> -<label - for="password" - class="input flex items-center justify-center gap-2 w-full" -> +<label for="password" class="input flex items-center justify-center gap-2 w-full"> {#if show} <input {name} type="text" bind:value class="clean" {placeholder} /> {:else} - <input - {name} - type="password" - bind:value - class="clean" - use:focus - {placeholder} - /> + <input {name} type="password" bind:value class="clean" use:focus {placeholder} /> {/if} <button type="button" aria-label="Toggle" onclick={toggle} class="contents"> <iconify-icon noobserver {icon} width="32"></iconify-icon> diff --git a/src/components/Payments.svelte b/src/components/Payments.svelte index 046356ca..ddbee1e0 100644 --- a/src/components/Payments.svelte +++ b/src/components/Payments.svelte @@ -18,8 +18,7 @@ class:border-b-0={i === payments.length - 1} class:text-error={amount < 0} onclick={() => goto(`/payment/${p.id}`)} - onkeydown={(e) => - (e.key === "Enter" || e.key === " ") && goto(`/payment/${p.id}`)} + onkeydown={(e) => (e.key === "Enter" || e.key === " ") && goto(`/payment/${p.id}`)} role="button" tabindex="0" > @@ -31,11 +30,7 @@ {f(Math.abs(amount) * (p.rate / sats), p.currency, locale)} </div> {:else} - <iconify-icon - noobserver - icon="ph:lightning-fill" - width="24" - class="text-yellow-300" + <iconify-icon noobserver icon="ph:lightning-fill" width="24" class="text-yellow-300" ></iconify-icon> <div>{s(Math.abs(amount), locale)}</div> {/if} @@ -49,9 +44,7 @@ {/if} </div> - <div - class="flex my-auto col-span-6 truncate text-ellipsis overflow-hidden mx-auto" - > + <div class="flex my-auto col-span-6 truncate text-ellipsis overflow-hidden mx-auto"> {#if p.type === types.fund} {#if fund} <div class="flex"> @@ -65,10 +58,7 @@ {:else} <a href={`/fund/${p.memo}`}> <div class="text-secondary flex"> - <iconify-icon - noobserver - icon="ph:lightning-fill" - class="text-yellow-300 text-3xl" + <iconify-icon noobserver icon="ph:lightning-fill" class="text-yellow-300 text-3xl" ></iconify-icon> <div class="my-auto">{$t("payments.fund")}</div> @@ -87,16 +77,12 @@ {:else} <div class="text-secondary flex items-center gap-1"> {#if p.type === types.lightning || p.type === types.bolt12} - <iconify-icon - noobserver - icon="ph:lightning-fill" - class="text-yellow-300 text-3xl" + <iconify-icon noobserver icon="ph:lightning-fill" class="text-yellow-300 text-3xl" ></iconify-icon> {:else if p.type === types.ecash} <img src="/images/cash.png" class="w-12" alt="Ecash" /> {:else if p.type === types.bitcoin} - <iconify-icon noobserver icon="logos:bitcoin" class="text-3xl" - ></iconify-icon> + <iconify-icon noobserver icon="logos:bitcoin" class="text-3xl"></iconify-icon> {:else if p.type === types.liquid} <div class="my-auto"> <img @@ -106,11 +92,7 @@ /> </div> {:else if p.type === types.ark} - <img - src="/images/ark.png" - class="w-10 h-10 rounded-full object-cover" - alt="Ark" - /> + <img src="/images/ark.png" class="w-10 h-10 rounded-full object-cover" alt="Ark" /> {/if} <div class="my-auto"> diff --git a/src/components/Pin.svelte b/src/components/Pin.svelte index 9c5d8664..72bbf78d 100644 --- a/src/components/Pin.svelte +++ b/src/components/Pin.svelte @@ -55,16 +55,12 @@ aria-labelledby="title" tabindex="-1" > - <div - class="mx-auto p-5 border shadow-lg rounded-md bg-base-100 space-y-5 max-w-lg" - > + <div class="mx-auto p-5 border shadow-lg rounded-md bg-base-100 space-y-5 max-w-lg"> <h1 id="title" class="text-center text-2xl font-semibold">{title}</h1> <Pinpad bind:v={p} {cancel} /> <div> - <label for="locktime" class="font-bold" - >{$t("user.settings.rememberFor")}</label - > + <label for="locktime" class="font-bold">{$t("user.settings.rememberFor")}</label> <select name="locktime" bind:value={locktime}> <option value={30}>30 {$t("user.settings.seconds")}</option> <option value={5 * 60}>5 {$t("user.settings.minutes")}</option> diff --git a/src/components/Pinpad.svelte b/src/components/Pinpad.svelte index 15dbc53e..3e9c490b 100644 --- a/src/components/Pinpad.svelte +++ b/src/components/Pinpad.svelte @@ -24,11 +24,7 @@ let validate = (e) => { let k = e.key || e.code; if (k === "Escape") cancel(); - if ( - e.key.length <= 1 && - !(e.metaKey || e.ctrlKey || e.altKey) && - !(k >= "0" && k <= "9") - ) { + if (e.key.length <= 1 && !(e.metaKey || e.ctrlKey || e.altKey) && !(k >= "0" && k <= "9")) { if (e.preventDefault) e.preventDefault(); else e.returnValue = false; } @@ -43,9 +39,7 @@ }; </script> -<label - class="input input-bordered border-primary input-lg rounded-2xl flex items-center gap-2" -> +<label class="input input-bordered border-primary input-lg rounded-2xl flex items-center gap-2"> {#if hide} <input onkeydown={validate} @@ -73,10 +67,7 @@ onclick={toggle} aria-label={hide ? "Show PIN" : "Hide PIN"} > - <iconify-icon - noobserver - icon={hide ? "ph:eye-slash-bold" : "ph:eye-bold"} - width="32" + <iconify-icon noobserver icon={hide ? "ph:eye-slash-bold" : "ph:eye-bold"} width="32" ></iconify-icon></button > </label> @@ -88,9 +79,7 @@ <Left /> </button> {:else} - <button type="button" class="btn" onclick={(e) => handleInput(e, value)} - >{value}</button - > + <button type="button" class="btn" onclick={(e) => handleInput(e, value)}>{value}</button> {/if} {/each} </div> diff --git a/src/components/Popup.svelte b/src/components/Popup.svelte index e696c5cc..58b37eae 100644 --- a/src/components/Popup.svelte +++ b/src/components/Popup.svelte @@ -4,11 +4,7 @@ let { tags } = $props(); let addr = (tags) => { - let { - "addr:housenumber": house, - "addr:street": street, - "addr:city": city, - } = tags; + let { "addr:housenumber": house, "addr:street": street, "addr:city": city } = tags; if (house) return `${house} ${street}`; return ""; }; diff --git a/src/components/Qr.svelte b/src/components/Qr.svelte index 37b1708c..c2014348 100644 --- a/src/components/Qr.svelte +++ b/src/components/Qr.svelte @@ -22,8 +22,7 @@ class="w-72 sm:w-80 mx-auto cursor-pointer" bind:this={qr} onclick={() => screenfull?.toggle?.(qr)} - onkeydown={(e) => - (e.key === "Enter" || e.key === " ") && screenfull?.toggle?.(qr)} + onkeydown={(e) => (e.key === "Enter" || e.key === " ") && screenfull?.toggle?.(qr)} role="button" tabindex="0" aria-label="Toggle fullscreen QR" diff --git a/src/components/SetAmount.svelte b/src/components/SetAmount.svelte index ce58e146..c339aa7d 100644 --- a/src/components/SetAmount.svelte +++ b/src/components/SetAmount.svelte @@ -21,33 +21,14 @@ {#if settingAmount} <div class="fixed inset-0 bg-base-100/90 overflow-y-auto h-full w-full z-50"> - <div - class="relative mx-auto p-12 max-w-xl shadow-lg rounded-md bg-base-100 space-y-5" - > + <div class="relative mx-auto p-12 max-w-xl shadow-lg rounded-md bg-base-100 space-y-5"> <form onsubmit={setAmount} class="space-y-5"> - <Numpad - bind:amount={newAmount} - bind:fiat - {currency} - {rate} - {submit} - {locale} - /> + <Numpad bind:amount={newAmount} bind:fiat {currency} {rate} {submit} {locale} /> <div class="w-full flex flex-wrap gap-2"> - <button - bind:this={submit} - type="submit" - onclick={setAmount} - class="btn btn-accent" - > + <button bind:this={submit} type="submit" onclick={setAmount} class="btn btn-accent"> <div class="my-auto">{t("payments.ok")}</div> </button> - <button - type="button" - class="btn" - onclick={toggleAmount} - onkeydown={toggleAmount} - > + <button type="button" class="btn" onclick={toggleAmount} onkeydown={toggleAmount}> <div class="my-auto">{t("payments.cancel")}</div> </button> </div> diff --git a/src/components/SetMemo.svelte b/src/components/SetMemo.svelte index 54921f56..e9f2524b 100644 --- a/src/components/SetMemo.svelte +++ b/src/components/SetMemo.svelte @@ -1,38 +1,19 @@ <script lang="ts"> import { focus } from "$lib/utils"; - let { - submit = $bindable(), - settingMemo, - setMemo, - memo = $bindable(), - toggleMemo, - t, - } = $props(); + let { submit = $bindable(), settingMemo, setMemo, memo = $bindable(), toggleMemo, t } = $props(); </script> {#if settingMemo} <div class="fixed inset-0 bg-base-100/90 overflow-y-auto h-full w-full z-50"> - <div - class="relative mx-auto p-12 max-w-xl shadow-lg rounded-md bg-base-100 space-y-5" - > + <div class="relative mx-auto p-12 max-w-xl shadow-lg rounded-md bg-base-100 space-y-5"> <form onsubmit={setMemo} class="space-y-5"> <input use:focus placeholder={t("invoice.memo")} bind:value={memo} /> <div class="w-full flex flex-wrap gap-2"> - <button - bind:this={submit} - type="submit" - onclick={setMemo} - class="btn btn-accent" - > + <button bind:this={submit} type="submit" onclick={setMemo} class="btn btn-accent"> <div class="my-auto">{t("payments.ok")}</div> </button> - <button - type="button" - class="btn" - onclick={toggleMemo} - onkeydown={toggleMemo} - > + <button type="button" class="btn" onclick={toggleMemo} onkeydown={toggleMemo}> <div class="my-auto">{t("payments.cancel")}</div> </button> </div> diff --git a/src/components/SetType.svelte b/src/components/SetType.svelte index d06ca345..5794700d 100644 --- a/src/components/SetType.svelte +++ b/src/components/SetType.svelte @@ -18,18 +18,8 @@ {#if settingType} <div class="fixed inset-0 bg-base-100/90 overflow-y-auto h-full w-full z-50"> - <div - class="relative mx-auto p-12 max-w-xl shadow-lg rounded-md bg-base-100 space-y-2" - > - <InvoiceTypes - bind:newAmount - {setAmount} - {invoice} - {user} - {setType} - {toggleType} - {t} - /> + <div class="relative mx-auto p-12 max-w-xl shadow-lg rounded-md bg-base-100 space-y-2"> + <InvoiceTypes bind:newAmount {setAmount} {invoice} {user} {setType} {toggleType} {t} /> </div> </div> {/if} diff --git a/src/components/Slider.svelte b/src/components/Slider.svelte index 846d32a6..946878ee 100644 --- a/src/components/Slider.svelte +++ b/src/components/Slider.svelte @@ -9,12 +9,4 @@ let { value = $bindable(), handle, min = 0, max = 100 }: Props = $props(); </script> -<input - id="slider" - type="range" - {min} - {max} - bind:value - class="range w-full" - oninput={handle} -/> +<input id="slider" type="range" {min} {max} bind:value class="range w-full" oninput={handle} /> diff --git a/src/components/Spinner.svelte b/src/components/Spinner.svelte index e9c3348f..f08cb3f3 100644 --- a/src/components/Spinner.svelte +++ b/src/components/Spinner.svelte @@ -4,14 +4,7 @@ fill="none" viewBox="0 0 24 24" > - <circle - class="opacity-25" - cx="12" - cy="12" - r="10" - stroke="currentColor" - stroke-width="4" - /> + <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4" /> <path class="opacity-75" fill="currentColor" diff --git a/src/components/Success.svelte b/src/components/Success.svelte index ae54b6c1..bd3214ce 100644 --- a/src/components/Success.svelte +++ b/src/components/Success.svelte @@ -2,14 +2,7 @@ import { browser } from "$app/environment"; import { scale } from "svelte/transition"; import Amount from "$comp/Amount.svelte"; - const { - amount, - tip = undefined, - rate, - currency, - locale, - title = "", - }: any = $props(); + const { amount, tip = undefined, rate, currency, locale, title = "" }: any = $props(); let ConfettiComp: any = $state(null); let loaded = $state(false); diff --git a/src/components/Toggle.svelte b/src/components/Toggle.svelte index 3f725d08..8aee2829 100644 --- a/src/components/Toggle.svelte +++ b/src/components/Toggle.svelte @@ -3,13 +3,7 @@ </script> <label for={id} class="inline-flex relative items-center mr-5 cursor-pointer"> - <input - type="checkbox" - bind:checked={value} - {id} - name={id} - class="sr-only peer" - /> + <input type="checkbox" bind:checked={value} {id} name={id} class="sr-only peer" /> <div class="w-11 h-6 bg-gray-200 rounded-full peer dark:bg-gray-700 peer-focus:ring-4 peer-focus:ring-gray-300 dark:peer-focus:ring-gray-800 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-green-500" ></div> diff --git a/src/components/WalletPass.svelte b/src/components/WalletPass.svelte index 9e0b6cd2..cc9e2bbd 100644 --- a/src/components/WalletPass.svelte +++ b/src/components/WalletPass.svelte @@ -24,9 +24,7 @@ </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" - > + <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> @@ -66,15 +64,12 @@ </button> </div> <div class="mb-5 space-y-2"> - <label for="rememberFor" class="text-sm text-gray-500"> - Remember for - </label> + <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))} + onchange={(e) => (rememberForMs = Number((e.target as HTMLSelectElement).value))} > {#each rememberForOptions as option} <option value={option.ms}>{option.label}</option> |
