diff options
| author | Adam Soltys <[email protected]> | 2026-02-27 23:09:19 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-02-27 23:09:19 -0800 |
| commit | 23a783c13302fbe6b29cb21e226f25b81cd88de6 (patch) | |
| tree | 3caa3f380328bca802c3d7fa95555cb8499e5d73 /src/routes/(app) | |
| parent | 6efa1762d7d7583a5cf191474e80252deff0df85 (diff) | |
| download | coinos-ui-23a783c13302fbe6b29cb21e226f25b81cd88de6.tar.gz coinos-ui-23a783c13302fbe6b29cb21e226f25b81cd88de6.zip | |
splash page update
Diffstat (limited to 'src/routes/(app)')
| -rw-r--r-- | src/routes/(app)/[username]/(profile)/+page.svelte | 29 | ||||
| -rw-r--r-- | src/routes/(app)/account/[id]/+page.svelte | 4 | ||||
| -rw-r--r-- | src/routes/(app)/account/new/+page.svelte | 14 | ||||
| -rw-r--r-- | src/routes/(app)/logout/+page.server.ts | 2 | ||||
| -rw-r--r-- | src/routes/(app)/settings/+layout.svelte | 4 |
5 files changed, 35 insertions, 18 deletions
diff --git a/src/routes/(app)/[username]/(profile)/+page.svelte b/src/routes/(app)/[username]/(profile)/+page.svelte index 41bc2152..38d5a522 100644 --- a/src/routes/(app)/[username]/(profile)/+page.svelte +++ b/src/routes/(app)/[username]/(profile)/+page.svelte @@ -8,7 +8,7 @@ import { installPrompt, password } from "$lib/store"; import { afterNavigate, goto, invalidate, preloadData } from "$app/navigation"; import { page } from "$app/stores"; - import { versions, post, fail } from "$lib/utils"; + import { versions, post, fail, getCookie } from "$lib/utils"; let { data } = $props(); @@ -65,10 +65,19 @@ adding = false; }; + let installDismissed = $state(browser && localStorage.getItem("installDismissed") === "1"); + let showInstall = $derived($installPrompt && !installDismissed); + let install = async () => { if (!$installPrompt) return; await $installPrompt.prompt(); $installPrompt = null; + dismissInstall(); + }; + + let dismissInstall = () => { + installDismissed = true; + localStorage.setItem("installDismissed", "1"); }; let pubkey = $state(); @@ -124,18 +133,24 @@ <div class="text-sm">{$t("incident")}</div> {/if} - {#if $installPrompt} - <button class="btn btn-accent w-full lg:hidden" onclick={install}> - <iconify-icon noobserver icon="ph:download-bold" width="32"></iconify-icon> - {$t("user.install")} - </button> - {/if} </div> {/if} </div> <!-- <a href="/funder" class="btn">Funder</a> --> +{#if showInstall} + <div class="fixed inset-x-0 bottom-0 z-[100] p-4 pb-[calc(1rem+var(--safe-area-inset-bottom))] bg-base-100 border-t border-base-300 shadow-lg lg:hidden"> + <div class="max-w-xl mx-auto flex items-center gap-3"> + <div class="flex-1"> + <p class="font-semibold">Add Coinos to homescreen?</p> + </div> + <button class="btn btn-accent !w-auto px-6" onclick={install}>Yes</button> + <button class="btn !w-auto px-6" onclick={dismissInstall}>No</button> + </div> + </div> +{/if} + <div class="fixed inset-x-0 mx-auto flex bottom-16 px-4"> {#if user?.username !== subject.username && (!subject.anon || subject.lud16)} <a diff --git a/src/routes/(app)/account/[id]/+page.svelte b/src/routes/(app)/account/[id]/+page.svelte index 0f712c7f..cae3d030 100644 --- a/src/routes/(app)/account/[id]/+page.svelte +++ b/src/routes/(app)/account/[id]/+page.svelte @@ -143,7 +143,7 @@ {:else} <img src="/images/icon.png" class="w-8 h-8" alt="Coinos" /> {/if} - {displayType} account + {$t("accounts.accountTitle", { type: displayType })} </h1> <div class="container w-full mx-auto text-lg px-4 max-w-xl space-y-2"> @@ -169,7 +169,7 @@ {#if currencyChanged} <div class="flex justify-between items-center"> - <span>Also update default currency to {currency}</span> + <span>{$t("accounts.updateCurrency", { currency })}</span> <Toggle id="updateUserCurrency" bind:value={updateUserCurrency} /> </div> {/if} diff --git a/src/routes/(app)/account/new/+page.svelte b/src/routes/(app)/account/new/+page.svelte index db0361f8..4ad1fddb 100644 --- a/src/routes/(app)/account/new/+page.svelte +++ b/src/routes/(app)/account/new/+page.svelte @@ -20,7 +20,7 @@ const { getWalletEntropy } = await import("$lib/walletEntropy"); const entropy = await getWalletEntropy(); if (!entropy) { - fail($t("accounts.failedToDecryptSeed")); + fail($t("accounts.failedToDecryptSeed") as string); creatingArk = false; return; } @@ -40,23 +40,23 @@ goto(`/${user.username}`); } catch (e: any) { console.log("Ark account creation failed", e); - fail(e.message || $t("accounts.failedToDecryptSeed")); + fail(e.message || ($t("accounts.failedToDecryptSeed") as string)); creatingArk = false; } }; </script> <div class="space-y-5"> - <h1 class="text-center text-3xl font-semibold">Choose account type</h1> + <h1 class="text-center text-3xl font-semibold">{$t("accounts.chooseAccountType")}</h1> <div class="container w-full mx-auto text-lg px-4 max-w-xl space-y-5"> <a href="/account/bitcoin" class="block"> <div class="card card-side shadow shadow-base-300 p-8 hover:bg-base-200 gap-4 items-center"> <iconify-icon noobserver icon="logos:bitcoin" width={48}></iconify-icon> <div> - <div class="text-xl">Bitcoin (On-chain)</div> + <div class="text-xl">{$t("accounts.bitcoinOnChain")}</div> <div class="text-secondary"> - Self-custodial Bitcoin wallet secured by a 12-word seed phrase + {$t("accounts.bitcoinOnChainDesc")} </div> </div> </div> @@ -70,9 +70,9 @@ <img src="/images/ark.png" class="w-12 h-12 rounded-full object-cover bg-neutral" alt="Ark" /> {/if} <div> - <div class="text-xl">Ark (Off-chain)</div> + <div class="text-xl">{$t("accounts.arkOffChain")}</div> <div class="text-secondary"> - Experimental layer 2 wallet offering low fees and fast settlement + {$t("accounts.arkOffChainDesc")} </div> </div> </div> diff --git a/src/routes/(app)/logout/+page.server.ts b/src/routes/(app)/logout/+page.server.ts index 0a8b5d3a..c8581e5f 100644 --- a/src/routes/(app)/logout/+page.server.ts +++ b/src/routes/(app)/logout/+page.server.ts @@ -15,5 +15,5 @@ export async function load({ cookies }) { cookies.set("sk", "", opts); cookies.set("theme", "", opts); cookies.set("sid", "", opts); - redirect(307, `/login?lang=${lang}`); + redirect(307, lang ? `/login?lang=${lang}` : "/login"); } diff --git a/src/routes/(app)/settings/+layout.svelte b/src/routes/(app)/settings/+layout.svelte index 99bdc4ce..29e9489c 100644 --- a/src/routes/(app)/settings/+layout.svelte +++ b/src/routes/(app)/settings/+layout.svelte @@ -5,7 +5,7 @@ import { applyAction, deserialize } from "$app/forms"; import Spinner from "$comp/Spinner.svelte"; import Pin from "$comp/Pin.svelte"; - import { loading, t } from "$lib/translations"; + import { loading, locale, setLocale, t } from "$lib/translations"; import { fd, fail, auth, post, sleep, warning, success } from "$lib/utils"; import { avatar, banner, signer, password, pin, save } from "$lib/store"; import { upload } from "$lib/upload"; @@ -238,7 +238,9 @@ console.log("Failed to save re-wrapped encryptedKeys", e); } } + const currentLocale = $locale; await invalidateAll(); + if (currentLocale !== $locale) await setLocale(currentLocale); if (pw) $password = pw; } |
