diff options
| author | Adam Soltys <[email protected]> | 2024-11-26 20:54:49 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-11-26 20:54:49 -0800 |
| commit | 872aa0b3b0b9a847b8afcdee7f1ad53c524ce4f0 (patch) | |
| tree | 4d505c5b7c3f137b56c84cfaca12ed486aa4972c /src/routes/(app) | |
| parent | f9300236a3c0227e0eec58326fa322e58613bc2d (diff) | |
| download | coinos-ui-872aa0b3b0b9a847b8afcdee7f1ad53c524ce4f0.tar.gz coinos-ui-872aa0b3b0b9a847b8afcdee7f1ad53c524ce4f0.zip | |
warnings
Diffstat (limited to 'src/routes/(app)')
| -rw-r--r-- | src/routes/(app)/send/invoice/[id]/+page.svelte | 19 | ||||
| -rw-r--r-- | src/routes/(app)/sent/[id]/+page.svelte | 6 | ||||
| -rw-r--r-- | src/routes/(app)/settings/security/+page.svelte | 32 |
3 files changed, 16 insertions, 41 deletions
diff --git a/src/routes/(app)/send/invoice/[id]/+page.svelte b/src/routes/(app)/send/invoice/[id]/+page.svelte index d2b3727c..f0811f2e 100644 --- a/src/routes/(app)/send/invoice/[id]/+page.svelte +++ b/src/routes/(app)/send/invoice/[id]/+page.svelte @@ -13,32 +13,23 @@ import Numpad from "$comp/Numpad.svelte"; import Spinner from "$comp/Spinner.svelte"; import { page } from "$app/stores"; - import { - btc, - sat, - post, - back, - f, - toFiat, - s, - sats, - focus, - } from "$lib/utils"; + import { btc, sat, post, back, f, toFiat, s, sats, focus } from "$lib/utils"; let { data, form } = $props(); let { invoice, rates, user } = $state(data); let { address, hash, payreq, user: recipient, tip } = $state(invoice); let { currency } = $state(user); + let { amount } = $state(form || invoice); - let amount = $state(form?.amount || invoice.amount); let rate = $derived( invoice.rate * (rates[user.currency] / rates[invoice.currency]), ); + let a = $state(), af = $state(), - fiat = $state(!amount); + fiat = $state(untrack(() => !amount)); - let amountFiat = $state(amount * (rate / sats)); + let amountFiat = $state((untrack(() => amount) * untrack(() => rate)) / sats); let setAmount = () => { amount = a; amountFiat = af; diff --git a/src/routes/(app)/sent/[id]/+page.svelte b/src/routes/(app)/sent/[id]/+page.svelte index 2eb1f18b..d973d35d 100644 --- a/src/routes/(app)/sent/[id]/+page.svelte +++ b/src/routes/(app)/sent/[id]/+page.svelte @@ -4,13 +4,13 @@ import Success from "$comp/Success.svelte"; let { data } = $props(); - let { amount, rate, tip, user } = $state(data); + let { rate, tip, user } = $state(data); let { currency, username } = user; - amount = Math.abs(amount); + let amount = $state(Math.abs(data.amount)); </script> <Success {amount} {rate} {tip} {currency} title={`${$t("payments.sent")}!`} /> -<a href={`/${username}`} use:focus> +<a href={`/${username}`} use:focus aria-label="Continue"> <div class="opacity-0 w-screen h-screen fixed top-0 left-0 z-50"></div> </a> diff --git a/src/routes/(app)/settings/security/+page.svelte b/src/routes/(app)/settings/security/+page.svelte index cc988d6c..d40439ac 100644 --- a/src/routes/(app)/settings/security/+page.svelte +++ b/src/routes/(app)/settings/security/+page.svelte @@ -1,12 +1,11 @@ <script> import { getContext } from "svelte"; - import { getMnemonic, getNsec } from "$lib/nostr"; import { tick } from "svelte"; import { t } from "$lib/translations"; import Pin from "$comp/Pin.svelte"; - import Icon from "$comp/Icon.svelte"; import Qr from "$comp/Qr.svelte"; + import PasswordInput from "$comp/PasswordInput.svelte"; import { copy, post, success, fail } from "$lib/utils"; import { save, pin as current } from "$lib/store"; import { invalidate } from "$app/navigation"; @@ -48,7 +47,6 @@ } }; - let togglePassword = () => (revealPassword = !revealPassword); let toggleSeed = async () => { try { mnemonic = await getMnemonic(user); @@ -168,26 +166,8 @@ <label for="password" class="block font-bold block mb-1" >{$t("user.settings.newPassword")}</label > - <label - for="password" - class="input flex items-center justify-center gap-2 w-full" - > - {#if revealPassword} - <input name="password" type="text" bind:value={password} class="clean" /> - {:else} - <input - name="password" - type="password" - bind:value={password} - class="clean" - /> - {/if} - <iconify-icon - onclick={togglePassword} - icon={revealPassword ? "ph:eye-bold" : "ph:eye-slash-bold"} - width="32" - ></iconify-icon> - </label> + + <PasswordInput bind:value={password} /> </div> <div> @@ -299,7 +279,11 @@ {/if} {#if revealNsec} - <button type="button" class="btn break-all !h-auto font-normal leading-normal flex-nowrap" onclick={() => copy(nsec)}> + <button + type="button" + class="btn break-all !h-auto font-normal leading-normal flex-nowrap" + onclick={() => copy(nsec)} + > <div>{nsec}</div> <iconify-icon icon="ph:copy-bold" width="32"></iconify-icon> |
