From 75dcf71144d6e303b9180d3ded614ccd975221f1 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 25 Apr 2025 14:05:25 -0700 Subject: move add account button to security page --- src/routes/(app)/settings/security/+page.svelte | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src/routes/(app)/settings') diff --git a/src/routes/(app)/settings/security/+page.svelte b/src/routes/(app)/settings/security/+page.svelte index 5d4b492f..ea1bf1f9 100644 --- a/src/routes/(app)/settings/security/+page.svelte +++ b/src/routes/(app)/settings/security/+page.svelte @@ -187,7 +187,8 @@ /> {:else} {:else if user.twofa} {:else} {/if} @@ -240,3 +243,13 @@ /> {/if} + +
+ + + +
-- cgit v1.2.3 From 5d4c882cc48bbee005ba65f082ad7bd771070b3d Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 3 May 2025 08:43:35 -0700 Subject: settings re-org --- src/components/Payments.svelte | 11 +- src/locales/en.json | 6 +- src/routes/(app)/settings/+layout.svelte | 25 +- src/routes/(app)/settings/account/+page.server.ts | 6 + src/routes/(app)/settings/account/+page.svelte | 387 +++++++++++++-------- .../(app)/settings/preferences/+page.server.ts | 11 - src/routes/(app)/settings/preferences/+page.svelte | 291 ---------------- src/routes/(app)/settings/profile/+page.server.ts | 5 + src/routes/(app)/settings/profile/+page.svelte | 169 +++++++++ 9 files changed, 456 insertions(+), 455 deletions(-) delete mode 100644 src/routes/(app)/settings/preferences/+page.server.ts delete mode 100644 src/routes/(app)/settings/preferences/+page.svelte create mode 100644 src/routes/(app)/settings/profile/+page.server.ts create mode 100644 src/routes/(app)/settings/profile/+page.svelte (limited to 'src/routes/(app)/settings') diff --git a/src/components/Payments.svelte b/src/components/Payments.svelte index 814a5b4e..36633089 100644 --- a/src/components/Payments.svelte +++ b/src/components/Payments.svelte @@ -6,6 +6,7 @@ import { t } from "$lib/translations"; import locales from "$lib/locales"; const { fund, locale, user, payments } = $props(); + const language = $derived(user?.language || "en");
@@ -106,7 +107,11 @@ {#if p.type === types.ecash} {amount > 0 ? $t("payments.redeemed") : $t("payments.minted")} {:else} - {amount > 0 ? (p.confirmed ? $t("payments.received") : $t("payments.pending")) : $t("payments.sent")} + {amount > 0 + ? p.confirmed + ? $t("payments.received") + : $t("payments.pending") + : $t("payments.sent")} {/if}
@@ -116,12 +121,12 @@
{format(new Date(p.created), "h:mm aaa", { - locale: locales[user.language], + locale: locales[language], })}
{format(new Date(p.created), "MMM d, yy", { - locale: locales[user.language], + locale: locales[language], })}
diff --git a/src/locales/en.json b/src/locales/en.json index ca580e41..d6d9ca89 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -294,6 +294,7 @@ "placeholder": "Enter an address, invoice or username" }, "settings": { + "nostr": "Nostr", "name": "Name", "integrations": "Integrations", "syncWithExtension": "Sync with extension", @@ -325,7 +326,7 @@ "nwc": "Nostr wallet connect (NWC)", "nwcDescription": "Enable nostr apps to send payments from your account", "seedDescription": "This 12 word seed phrase is used to derive your nostr private key and your self-custodial wallet keys which determine your auto-withdrawal addresses. Back it up and don't let anyone see it.", - "emailDescription": "For password resets and payment notifications only", + "emailDescription": "For password resets and payment notifications", "hideNsec": "Hide nostr secret key", "saved": "Settings saved!", "verifying": "Verification email sent", @@ -340,7 +341,8 @@ "accountId": "Account Secret", "header": "Settings", "ACCOUNT": "PROFILE", - "POINT_OF_SALE": "SETTINGS", + "POINT_OF_SALE": "ACCOUNT", + "NOSTR": "NOSTR", "SECURITY": "SECURITY", "locale": "Language", "username": "Username", diff --git a/src/routes/(app)/settings/+layout.svelte b/src/routes/(app)/settings/+layout.svelte index 2fe95813..33398ed5 100644 --- a/src/routes/(app)/settings/+layout.svelte +++ b/src/routes/(app)/settings/+layout.svelte @@ -36,8 +36,9 @@ }; let tabs = [ - { name: "account", key: "ACCOUNT" }, - { name: "preferences", key: "POINT_OF_SALE" }, + { name: "profile", key: "ACCOUNT" }, + { name: "account", key: "POINT_OF_SALE" }, + { name: "nostr", key: "NOSTR" }, { name: "security", key: "SECURITY" }, ]; @@ -208,16 +209,16 @@ {$t("user.settings.header")} -
- {#each tabs.filter((t) => t.name !== "shopify") as { name, key }} - - + diff --git a/src/routes/(app)/settings/account/+page.server.ts b/src/routes/(app)/settings/account/+page.server.ts index 4145935e..f0cc700e 100644 --- a/src/routes/(app)/settings/account/+page.server.ts +++ b/src/routes/(app)/settings/account/+page.server.ts @@ -1,5 +1,11 @@ +import getRates from "$lib/rates"; import updateUser from "$lib/settings"; +export async function load() { + const rates = await getRates(); + return { rates }; +} + export const actions = { default: updateUser, }; diff --git a/src/routes/(app)/settings/account/+page.svelte b/src/routes/(app)/settings/account/+page.svelte index d4178fd1..c5c75d88 100644 --- a/src/routes/(app)/settings/account/+page.svelte +++ b/src/routes/(app)/settings/account/+page.svelte @@ -1,58 +1,98 @@
- {$t("user.settings.locale")} -
- -
+
- {$t("user.settings.localCurrency")} - +
@@ -86,108 +128,181 @@ > {#if verified} - {:else if email} - {/if}
-
- {$t("user.settings.profileImage")} +
+
+ {$t("user.settings.notifications")} + +
+

+ {$t("user.settings.notificationsDesc")} +

+
-
- {#if $avatar || picture} -
- {username} -
- {:else} -
+
+
+ {$t("user.settings.pushNotifications")} + {#if permission !== "denied"} + {/if} -
- - - handleFile(e, "picture")} - /> -
+

+ {#if permission === "denied"} + {$t("user.settings.pushNotificationsDisabled")} + {:else} + {$t("user.settings.pushNotificationsDesc")} + {/if} +

+
- {#if tooLarge["avatar"]} -
Max file size 10MB
- {/if} +
+
+ {$t("user.settings.tipPrompt")} + +
+

+ {$t("user.settings.tipPromptDescription")} +

-
+
- {$t("user.settings.bannerImage")} + {$t("user.settings.autoWithdraw")} +
+

+ {$t("user.settings.autoWithdrawDescription")} +

+
- {#if $bannerStore || banner} - Banner - {:else} -
- {/if} - - + + +
+ +
+ + +

+ {$t("user.settings.thresholdDesc")} +

+
+ +
+ + +

+ {$t("user.settings.reserveDesc")} +

+
+{/if} + +{#if editingThreshold} +
- handleFile(e, "banner")} - /> - - {#if tooLarge["banner"]} -
Max file size 10MB
- {/if} -
+
+

+ {$t("user.settings.threshold")} +

+ -
- Ok +
+
+{/if} + +{#if editingReserve} +
- -
+
+

+ {$t("user.settings.reserve")} +

+ + +
+
+{/if} diff --git a/src/routes/(app)/settings/preferences/+page.server.ts b/src/routes/(app)/settings/preferences/+page.server.ts deleted file mode 100644 index f0cc700e..00000000 --- a/src/routes/(app)/settings/preferences/+page.server.ts +++ /dev/null @@ -1,11 +0,0 @@ -import getRates from "$lib/rates"; -import updateUser from "$lib/settings"; - -export async function load() { - const rates = await getRates(); - return { rates }; -} - -export const actions = { - default: updateUser, -}; diff --git a/src/routes/(app)/settings/preferences/+page.svelte b/src/routes/(app)/settings/preferences/+page.svelte deleted file mode 100644 index 0f30c61b..00000000 --- a/src/routes/(app)/settings/preferences/+page.svelte +++ /dev/null @@ -1,291 +0,0 @@ - - -
- - -
- -
- - -
- -
- - -
- -
-
- {$t("user.settings.notifications")} - -
-

- {$t("user.settings.notificationsDesc")} -

-
- -
-
- {$t("user.settings.pushNotifications")} - {#if permission !== "denied"} - - {/if} -
-

- {#if permission === "denied"} - {$t("user.settings.pushNotificationsDisabled")} - {:else} - {$t("user.settings.pushNotificationsDesc")} - {/if} -

-
- -
-
- {$t("user.settings.tipPrompt")} - -
-

- {$t("user.settings.tipPromptDescription")} -

-
- -
-
- {$t("user.settings.autoWithdraw")} - -
-

- {$t("user.settings.autoWithdrawDescription")} -

-
- -{#if user.autowithdraw} -
- - -
- -
- - -

- {$t("user.settings.thresholdDesc")} -

-
- -
- - -

- {$t("user.settings.reserveDesc")} -

-
-{/if} - -{#if editingThreshold} -
-
-

- {$t("user.settings.threshold")} -

- - - -
-
-{/if} - -{#if editingReserve} -
-
-

- {$t("user.settings.reserve")} -

- - -
-
-{/if} diff --git a/src/routes/(app)/settings/profile/+page.server.ts b/src/routes/(app)/settings/profile/+page.server.ts new file mode 100644 index 00000000..4145935e --- /dev/null +++ b/src/routes/(app)/settings/profile/+page.server.ts @@ -0,0 +1,5 @@ +import updateUser from "$lib/settings"; + +export const actions = { + default: updateUser, +}; diff --git a/src/routes/(app)/settings/profile/+page.svelte b/src/routes/(app)/settings/profile/+page.svelte new file mode 100644 index 00000000..bee50d39 --- /dev/null +++ b/src/routes/(app)/settings/profile/+page.svelte @@ -0,0 +1,169 @@ + + +
+ +
+ +
+
+ +
+ + +
+ +
+ {$t("user.settings.profileImage")} + +
+ {#if $avatar || picture} +
+ {username} +
+ {:else} +
+ {/if} +
+ + + handleFile(e, "picture")} + /> +
+
+ + {#if tooLarge["avatar"]} +
Max file size 10MB
+ {/if} +
+ +
+
+ {$t("user.settings.bannerImage")} +
+ + {#if $bannerStore || banner} + Banner + {:else} +
+ {/if} + + + handleFile(e, "banner")} + /> + + {#if tooLarge["banner"]} +
Max file size 10MB
+ {/if} +
+ +
+ + +
-- cgit v1.2.3 From 2d9d01d6e8d63ee223078874aa3b101b016367ac Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 8 Jul 2025 10:16:22 -0700 Subject: auto pay --- src/locales/en.json | 3 ++ src/routes/(app)/fund/[id]/+page.svelte | 2 +- src/routes/(app)/invoice/[id]/tip/+page.server.ts | 21 ++++++++++-- src/routes/(app)/send/[...text]/+page.svelte | 37 +++++++++++++++++----- src/routes/(app)/send/invoice/[id]/+page.server.ts | 14 ++++++-- src/routes/(app)/send/invoice/[id]/+page.svelte | 21 +++++++++++- src/routes/(app)/settings/account/+page.svelte | 15 ++++++++- 7 files changed, 97 insertions(+), 16 deletions(-) (limited to 'src/routes/(app)/settings') diff --git a/src/locales/en.json b/src/locales/en.json index c4ca5e17..922d24b3 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -296,6 +296,8 @@ "placeholder": "Enter an address, invoice or username" }, "settings": { + "tip": "Default tip", + "tipDesc": "Default tip percentage when auto-paying trusted users", "nostr": "Nostr", "name": "Name", "integrations": "Integrations", @@ -398,6 +400,7 @@ } }, "payments": { + "trustUser": "Send and enable auto-pay", "sweep": "Sweep link", "lockedBalance": "Locked balance", "insufficientFunds": "Insufficient funds", diff --git a/src/routes/(app)/fund/[id]/+page.svelte b/src/routes/(app)/fund/[id]/+page.svelte index 614616af..7f465512 100644 --- a/src/routes/(app)/fund/[id]/+page.svelte +++ b/src/routes/(app)/fund/[id]/+page.svelte @@ -112,7 +112,7 @@
{$t("payments.shareLink")}
{/if} - + {/each} diff --git a/src/routes/(app)/send/invoice/[id]/+page.server.ts b/src/routes/(app)/send/invoice/[id]/+page.server.ts index 3ef933d4..4bb7ded5 100644 --- a/src/routes/(app)/send/invoice/[id]/+page.server.ts +++ b/src/routes/(app)/send/invoice/[id]/+page.server.ts @@ -2,11 +2,19 @@ import getRates from "$lib/rates"; import { auth, fd, get, post, types } from "$lib/utils"; import { error, redirect } from "@sveltejs/kit"; -export async function load({ cookies, params: { id }, parent }) { +export async function load({ cookies, depends, params: { id }, parent }) { + depends("app:trust"); const { user } = await parent(); const aid = cookies.get("aid") || user.id; - const invoice = await get(`/invoice/${id}`); + let invoice = await get(`/invoice/${id}`); + + const trust = await get("/trust", auth(cookies)); + const trusted = trust.includes(invoice.uid); + if (trusted) { + const p = await post("/payments", invoice, auth(cookies)); + redirect(307, `/sent/${p.id}`); + } if (invoice.amount && invoice.prompt && invoice.tip === null) redirect(307, `/invoice/${id}/tip`); @@ -31,7 +39,7 @@ export async function load({ cookies, params: { id }, parent }) { const invoiceRate = rates[invoice.currency]; const { balance } = await get(`/account/${aid}`, auth(cookies)); - return { balance, invoice, user, rate, invoiceRate }; + return { balance, invoice, user, rate, invoiceRate, trusted }; } export const actions = { diff --git a/src/routes/(app)/send/invoice/[id]/+page.svelte b/src/routes/(app)/send/invoice/[id]/+page.svelte index 7d167f41..9aac5c8d 100644 --- a/src/routes/(app)/send/invoice/[id]/+page.svelte +++ b/src/routes/(app)/send/invoice/[id]/+page.svelte @@ -1,4 +1,5 @@
+ {#if user?.fresh} +
+

{$t("user.settings.welcome")}

+
+ {$t("user.settings.yourUsername")} {user?.username} + {#if $password} + {$t("user.settings.yourPassword")} + {$password}{/if} +
+ +
{$t("user.settings.clickBelow")}
+ + + + Settings +
+ {/if} {#if user?.id && user.id === subject.id}
{#each accounts as account, i} @@ -55,6 +73,8 @@ {/if}
+ +
{#if user?.username !== subject.username && (!subject.anon || subject.lud16)} + import { onMount } from "svelte"; + import { password } from "$lib/store"; import Amount from "$comp/Amount.svelte"; import Success from "$comp/Success.svelte"; import { scale } from "svelte/transition"; @@ -9,9 +11,11 @@ let { data } = $props(); - let { amount, id, user, rate, rates } = data; + let { amount, id, user, rate, rates, password: pw } = data; let { currency } = user; let locale = $derived(loc(user)); + + onMount(() => ($password = pw));
diff --git a/src/routes/(app)/funder/+page.svelte b/src/routes/(app)/funder/+page.svelte new file mode 100644 index 00000000..e6549360 --- /dev/null +++ b/src/routes/(app)/funder/+page.svelte @@ -0,0 +1,55 @@ + + +HI + +{#if here}HERE{/if} +{#if ready}go{/if} +{#if success}done{/if} diff --git a/src/routes/(app)/invoice/[id]/tip/+page.server.ts b/src/routes/(app)/invoice/[id]/tip/+page.server.ts index de24c639..286d7c35 100644 --- a/src/routes/(app)/invoice/[id]/tip/+page.server.ts +++ b/src/routes/(app)/invoice/[id]/tip/+page.server.ts @@ -8,20 +8,22 @@ export async function load({ cookies, parent }) { let { invoice, subject, user } = await parent(); if (!invoice.amount) redirect(307, `/invoice/${invoice.id}`); - const trust = await get("/trust", auth(cookies)); - const trusted = trust.includes(invoice.uid); - if (trusted) { - if (invoice.prompt && invoice.tip === null && user.tip > 0) { - invoice.tip = Math.round(invoice.amount * (user.tip / 100)); - invoice = await post( - "/invoice", - { invoice, user: subject }, - auth(cookies), - ); - } + if (user) { + const trust = await get("/trust", auth(cookies)); + const trusted = trust.includes(invoice.uid); + if (trusted) { + if (invoice.prompt && invoice.tip === null && user.tip > 0) { + invoice.tip = Math.round(invoice.amount * (user.tip / 100)); + invoice = await post( + "/invoice", + { invoice, user: subject }, + auth(cookies), + ); + } - const p = await post("/payments", invoice, auth(cookies)); - redirect(307, `/sent/${p.id}`); + const p = await post("/payments", invoice, auth(cookies)); + redirect(307, `/sent/${p.id}`); + } } const rate = rates[subject?.currency]; diff --git a/src/routes/(app)/settings/profile/+page.svelte b/src/routes/(app)/settings/profile/+page.svelte index bee50d39..ec9855d0 100644 --- a/src/routes/(app)/settings/profile/+page.svelte +++ b/src/routes/(app)/settings/profile/+page.svelte @@ -3,16 +3,18 @@ import { avatar, banner as bannerStore } from "$lib/store"; import { t } from "$lib/translations"; import { page } from "$app/stores"; + import PasswordInput from "$comp/PasswordInput.svelte"; let { data } = $props(); let { user } = $derived(data); let { id } = user; - let { about, banner, picture, display, username } = - $state(user); + let { about, banner, picture, display, username } = $state(user); let avatarFile, avatarInput = $state(), bannerFile, + password = $state(), + revealPassword = $state(), bannerInput = $state(); let selectAvatar = () => avatarInput.click(); @@ -64,6 +66,16 @@
+ + +
+ + + +
+
- - -
- - - -
Date: Sat, 12 Jul 2025 11:09:28 -0700 Subject: auto withdrawal confirm --- src/locales/en.json | 8 +-- src/routes/(app)/[username]/(profile)/+page.svelte | 17 ++++++- .../(app)/[username]/accepted/[text]/+page.svelte | 55 ++++++++++----------- src/routes/(app)/settings/account/+page.svelte | 4 +- static/images/lntap.png | Bin 0 -> 377663 bytes static/images/tap.png | Bin 5462 -> 375651 bytes 6 files changed, 50 insertions(+), 34 deletions(-) create mode 100644 static/images/lntap.png (limited to 'src/routes/(app)/settings') diff --git a/src/locales/en.json b/src/locales/en.json index 6045b00d..72c3cd41 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -296,6 +296,8 @@ "placeholder": "Enter an address, invoice or username" }, "settings": { + "confirmAutoWithdrawal": "Confirm auto withdrawal settings", + "confirmAutoWithdrawalDesc": "Your auto withdrawals have been disabled. Please double check your destination address before re-enabling them or remove the address to dismiss this message.", "tip": "Default tip", "tipDesc": "Default tip percentage when auto-paying trusted users", "nostr": "Nostr", @@ -308,15 +310,15 @@ "memoPromptPlaceholder": "e.g. Please enter your name for the order", "rememberFor": "Remember for", "import": "Import secret key", - "destination": "Autowithdrawal address", + "destination": "Auto withdrawal address", "destinationDesc": "The address that withdrawals will be sent to", "destinationPlaceholder": "Enter a Bitcoin, Liquid or Lightning address", "reserve": "Reserve amount", "reserveDesc": "The amount to be left in your account after the withdrawal is complete", "shopify": "Shopify", - "threshold": "Autowithdrawal threshold", + "threshold": "Auto withdrawal threshold", "thresholdDesc": "When your balance exceeds this amount, a withdrawal will be triggered", - "autoWithdraw": "Autowithdrawal", + "autoWithdraw": "Auto withdrawal", "autoWithdrawDescription": "Enable withdrawals to an external address when your balance reaches a given threshold", "notifications": "Email notifications", "pushNotifications": "Push notifications", diff --git a/src/routes/(app)/[username]/(profile)/+page.svelte b/src/routes/(app)/[username]/(profile)/+page.svelte index 31320197..c60c468a 100644 --- a/src/routes/(app)/[username]/(profile)/+page.svelte +++ b/src/routes/(app)/[username]/(profile)/+page.svelte @@ -32,12 +32,27 @@
+ {#if user?.destination && !user?.autowithdraw} + + {/if} {#if user?.fresh}

{$t("user.settings.welcome")}

{$t("user.settings.yourUsername")} {user?.username} - {#if $password} + {#if $password} {$t("user.settings.yourPassword")} {$password}{/if}
diff --git a/src/routes/(app)/[username]/accepted/[text]/+page.svelte b/src/routes/(app)/[username]/accepted/[text]/+page.svelte index cfd9961f..d96e48e2 100644 --- a/src/routes/(app)/[username]/accepted/[text]/+page.svelte +++ b/src/routes/(app)/[username]/accepted/[text]/+page.svelte @@ -5,45 +5,44 @@ let { data } = $props(); let { nfc, text } = $derived(data); let { username } = $derived(data.subject); - let url = `https://coinos.io/p/${username}`; + let url = `https://coinos.io/p/${username.toLowerCase()}`;
-

Bitcoin Accepted Here

+

+ Bitcoin Accepted Here +

-
coinos.io/{username}
+
+ coinos.io/{username.toLowerCase()} +
{#if nfc}
-
-
- - -
Coinos
-
+
+ + +
-
-
- -
Other
- -
+
+ + + + + + +
{/if} diff --git a/src/routes/(app)/settings/account/+page.svelte b/src/routes/(app)/settings/account/+page.svelte index 481c8de7..d8b61170 100644 --- a/src/routes/(app)/settings/account/+page.svelte +++ b/src/routes/(app)/settings/account/+page.svelte @@ -204,7 +204,7 @@

-{#if user.autowithdraw} +
-{/if} +
{#if editingThreshold}
Date: Thu, 17 Jul 2025 16:18:30 -0700 Subject: square connection --- src/locales/en.json | 2 ++ src/routes/(app)/settings/account/+page.server.ts | 6 ++++-- src/routes/(app)/settings/account/+page.svelte | 16 +++++++++++++++- src/routes/(app)/settings/square/+page.server.ts | 18 ++++++++++++++++++ src/routes/(app)/settings/square/+page.svelte | 0 static/images/square.svg | 15 +++++++++++++++ 6 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 src/routes/(app)/settings/square/+page.server.ts create mode 100644 src/routes/(app)/settings/square/+page.svelte create mode 100644 static/images/square.svg (limited to 'src/routes/(app)/settings') diff --git a/src/locales/en.json b/src/locales/en.json index 77b2cb20..0ff021cd 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -296,6 +296,8 @@ "placeholder": "Enter an address, invoice or username" }, "settings": { + "connectSquare": "Connect to Square", + "revokeSquare": "Revoke Square Connection", "confirmAutoWithdrawal": "Confirm auto withdrawal settings", "confirmAutoWithdrawalDesc": "Your auto withdrawals have been disabled. Please double check your destination address before re-enabling them or remove the address to dismiss this message.", "tip": "Default tip", diff --git a/src/routes/(app)/settings/account/+page.server.ts b/src/routes/(app)/settings/account/+page.server.ts index f0cc700e..ebb90f05 100644 --- a/src/routes/(app)/settings/account/+page.server.ts +++ b/src/routes/(app)/settings/account/+page.server.ts @@ -1,9 +1,11 @@ import getRates from "$lib/rates"; import updateUser from "$lib/settings"; +import { auth, get } from "$lib/utils"; -export async function load() { +export async function load({ cookies }) { const rates = await getRates(); - return { rates }; + const connect = await get("/square/connect", auth(cookies)); + return { connect, rates }; } export const actions = { diff --git a/src/routes/(app)/settings/account/+page.svelte b/src/routes/(app)/settings/account/+page.svelte index d8b61170..26013cbb 100644 --- a/src/routes/(app)/settings/account/+page.svelte +++ b/src/routes/(app)/settings/account/+page.svelte @@ -13,7 +13,7 @@ let { data } = $props(); let { user } = $state(data); - let { rates, subscriptions } = data; + let { connect, rates, subscriptions } = data; let { currency, email, tip, verified } = $state(user); let rate = rates[currency]; @@ -97,6 +97,8 @@ $effect(() => { if (email !== user.email) verified = false; }); + + let revoke = () => {};
@@ -319,3 +321,15 @@
{/if} + +{#if connect !== "connected"} + + +
{$t("user.settings.connectSquare")}
+{:else} + +{/if} diff --git a/src/routes/(app)/settings/square/+page.server.ts b/src/routes/(app)/settings/square/+page.server.ts new file mode 100644 index 00000000..e00bdf1b --- /dev/null +++ b/src/routes/(app)/settings/square/+page.server.ts @@ -0,0 +1,18 @@ +import { auth, get } from "$lib/utils"; +import { fail, redirect } from "@sveltejs/kit"; + +export async function load({ cookies, url }) { + let connected; + + const query = url.searchParams.toString(); + + try { + await get(`/square/auth?${query}`, auth(cookies)); + connected = true; + } catch (e) { + const { message } = e as Error; + fail(400, { message }); + } + + if (connected) redirect(307, "/settings/account"); +} diff --git a/src/routes/(app)/settings/square/+page.svelte b/src/routes/(app)/settings/square/+page.svelte new file mode 100644 index 00000000..e69de29b diff --git a/static/images/square.svg b/static/images/square.svg new file mode 100644 index 00000000..14432609 --- /dev/null +++ b/static/images/square.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3 From 0c80f9122490002d175207374ac3a119963f6f70 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 17 Jul 2025 17:02:42 -0700 Subject: dark square icon --- src/routes/(app)/settings/account/+page.svelte | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/routes/(app)/settings') diff --git a/src/routes/(app)/settings/account/+page.svelte b/src/routes/(app)/settings/account/+page.svelte index 26013cbb..8b38ffe8 100644 --- a/src/routes/(app)/settings/account/+page.svelte +++ b/src/routes/(app)/settings/account/+page.svelte @@ -1,5 +1,6 @@

{$t("login.signIn")}

{#if form?.error && !form?.message.includes("2fa")} diff --git a/src/routes/(static)/register/+page.svelte b/src/routes/(static)/register/+page.svelte index edb63de1..b0368d47 100644 --- a/src/routes/(static)/register/+page.svelte +++ b/src/routes/(static)/register/+page.svelte @@ -222,7 +222,7 @@

{$t("login.createAccount")}

handleFile(e, "picture")} /> -- cgit v1.2.3 From 19769c1eafbcb97dbea37cf210497acb7aad56e8 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 9 Sep 2025 15:15:24 -0700 Subject: dark mode fix --- src/app.css | 10 +++++++++- src/routes/(app)/settings/nostr/+page.svelte | 3 ++- src/routes/+layout.svelte | 14 +++++++++++--- 3 files changed, 22 insertions(+), 5 deletions(-) (limited to 'src/routes/(app)/settings') diff --git a/src/app.css b/src/app.css index fca47b23..901893b9 100644 --- a/src/app.css +++ b/src/app.css @@ -48,7 +48,15 @@ html { font-family: PublicSans, sans-serif; } .input { @apply input-lg input-primary h-16 px-4; } /* If you want to *turn* native inputs into DaisyUI inputs via @apply: */ -input:not([type="range"]) { @apply input input-lg input-primary h-16 px-4; } +input[type="text"], +input[type="email"], +input[type="password"], +input[type="number"], +input[type="search"], +input[type="url"], +input[type="tel"] { + @apply input input-lg input-primary h-16 px-4; +} textarea { @apply textarea textarea-lg textarea-primary py-4; } select { @apply select select-lg select-primary h-16 px-4; } diff --git a/src/routes/(app)/settings/nostr/+page.svelte b/src/routes/(app)/settings/nostr/+page.svelte index 9129e8f3..7168f4f7 100644 --- a/src/routes/(app)/settings/nostr/+page.svelte +++ b/src/routes/(app)/settings/nostr/+page.svelte @@ -172,7 +172,7 @@ onclick={() => copy(npub)} aria-label="Copy" > {$t("accounts.copy")} +{$t("accounts.qr")}
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 8ae31608..7653e05a 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -7,13 +7,21 @@ import { onMount } from "svelte"; import { installPrompt, theme as themeStore } from "$lib/store"; + +const map = { light: 'lofi', dark: 'black', system: 'system' }; + let { data, children } = $props(); let { pathname, theme } = $state(data); $effect(() => ($themeStore = data.theme)); $effect(() => (theme = $themeStore)); - $effect(() => { - document.documentElement.setAttribute("data-theme", theme); - }); +$effect(() => { + const v = map[theme] ?? theme; + if (!v || v === 'system') { + document.documentElement.removeAttribute('data-theme'); + } else { + document.documentElement.setAttribute('data-theme', v); + } +}); let host = PUBLIC_DOMAIN.includes("localhost") ? `http://${PUBLIC_DOMAIN}` -- cgit v1.2.3