From 674de46a6a9f1b793313b5c027a34d396217ed84 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 5 Nov 2024 00:10:30 -0800 Subject: dark styles --- src/components/AppHeader.svelte | 19 ++- src/components/Code.svelte | 2 +- src/components/InvoiceActions.svelte | 50 ++++++++ src/components/InvoiceData.svelte | 72 ++++++++++++ src/components/LandingHeader.svelte | 9 +- src/components/LocationsMap.svelte | 6 +- src/locales/en.json | 1 + src/routes/(app)/+layout.svelte | 2 +- .../(app)/[username]/(profile)/+layout.svelte | 42 +++---- src/routes/(app)/[username]/receive/+page.svelte | 107 +++++------------ src/routes/(app)/fund/[id]/sweep/+page.svelte | 2 +- src/routes/(app)/invoice/[id]/+layout@.svelte | 2 +- src/routes/(app)/invoice/[id]/+page.svelte | 128 +++++---------------- src/routes/(app)/invoice/[id]/paid/+page.svelte | 2 +- src/routes/(app)/ln/withdrawal/sent/+page.svelte | 2 +- .../(app)/pay/[username]/[...amount]/+page.svelte | 2 +- src/routes/(app)/payments/[...page]/+page.svelte | 9 +- src/routes/(app)/send/invoice/[id]/+page.svelte | 12 +- .../(app)/send/lightning/[payreq]/+page.svelte | 56 ++++----- src/routes/(app)/sent/[id]/+page.svelte | 2 +- src/routes/(app)/verify/[code]/+page.svelte | 2 +- src/routes/(static)/docs/+page.svelte | 8 +- 22 files changed, 261 insertions(+), 276 deletions(-) create mode 100644 src/components/InvoiceActions.svelte create mode 100644 src/components/InvoiceData.svelte (limited to 'src') diff --git a/src/components/AppHeader.svelte b/src/components/AppHeader.svelte index e4c971c0..6b2497aa 100644 --- a/src/components/AppHeader.svelte +++ b/src/components/AppHeader.svelte @@ -131,11 +131,20 @@ class="flex justify-center items-center font-semibold hover:opacity-80 gap-2" on:click={dark} > - - {$t(key)} + + {$t(`nav.${$theme === "dark" ? "light" : "dark"}`)} {:else} - + + {/if} diff --git a/src/components/Code.svelte b/src/components/Code.svelte index c8c1058a..7ec046a6 100644 --- a/src/components/Code.svelte +++ b/src/components/Code.svelte @@ -6,7 +6,7 @@
{samples[sample]}
diff --git a/src/components/InvoiceActions.svelte b/src/components/InvoiceActions.svelte new file mode 100644 index 00000000..47dbffbb --- /dev/null +++ b/src/components/InvoiceActions.svelte @@ -0,0 +1,50 @@ + + +
+ + + {#if user?.id === invoice?.user?.id} + + {:else} + + + + {/if} + + {#if txt.startsWith("ln")} +
+ +
+ {/if} +
diff --git a/src/components/InvoiceData.svelte b/src/components/InvoiceData.svelte new file mode 100644 index 00000000..7723eb56 --- /dev/null +++ b/src/components/InvoiceData.svelte @@ -0,0 +1,72 @@ + + +{#if showQr} +
+ + {txt} + +
+{/if} + +{#if !showQr || !txt.startsWith("ln")} +
+ {txt} +
+{/if} + +{#each invoice.items as i} +
+
{i.quantity}
+
+ {i.name} +
+
+ {f(i.price * i.quantity, currency)} +
+
+ {sat(btc(i.price * i.quantity, rate))} +
+
+{/each} + +{#if amount > 0} +
+
+ {f(amountFiat, currency)} + + {#if tip} + + +{f(tip * (rate / sats), currency)} + + {/if} +
+
+ ⚡️{`${s(amount)}`} + + {#if tip} + + +⚡️{s(tip)} + + {/if} +
+
+{/if} diff --git a/src/components/LandingHeader.svelte b/src/components/LandingHeader.svelte index b3ecd159..b46d2790 100644 --- a/src/components/LandingHeader.svelte +++ b/src/components/LandingHeader.svelte @@ -47,23 +47,22 @@ > {/if} {#if user} - - {:else} - - {/if}
- {#if subject.address || subject.about} @@ -179,13 +178,10 @@
- +
@@ -199,7 +195,7 @@
- +
@@ -220,10 +216,10 @@
- +
@@ -234,24 +230,14 @@
{#if user && user.username !== subject.username && subject.pubkey} {#if following} - {:else} - {/if} {/if} @@ -277,7 +263,7 @@ class="rounded-2xl border py-5 px-6 font-bold hover:opacity-80 flex w-60" >
- +
diff --git a/src/routes/(app)/[username]/receive/+page.svelte b/src/routes/(app)/[username]/receive/+page.svelte index 446003e2..e9e5ca43 100644 --- a/src/routes/(app)/[username]/receive/+page.svelte +++ b/src/routes/(app)/[username]/receive/+page.svelte @@ -5,6 +5,8 @@ import { browser } from "$app/environment"; import { last, showQr, amountPrompt } from "$lib/store"; import Avatar from "$comp/Avatar.svelte"; + import InvoiceData from "$comp/InvoiceData.svelte"; + import InvoiceActions from "$comp/InvoiceActions.svelte"; import InvoiceTypes from "$comp/InvoiceTypes.svelte"; import SetAmount from "$comp/SetAmount.svelte"; import { t } from "$lib/translations"; @@ -80,87 +82,32 @@
- {#if $showQr} -
- - {txt} - -
- {/if} - -
+ - - {#each invoice.items as i} -
-
{i.quantity}
-
- {i.name} -
-
- {f(i.price * i.quantity, currency)} -
-
- {sat(btc(i.price * i.quantity, rate))} -
-
- {/each} - - {#if amount > 0} -
-
- {f(amountFiat, currency)} - - {#if tip} - - +{f(tip * (rate / sats), currency)} - - {/if} -
-
- ⚡️{`${s(amount)}`} - - {#if tip} - - +⚡️{s(tip)} - - {/if} -
-
- {/if} - -
- - - {#if user?.id === invoice?.user?.id} - - {:else} - - - - {/if} -
+ {invoice} + {amount} + {amountFiat} + {currency} + {tip} + {rate} + showQr={$showQr} + /> + +
diff --git a/src/routes/(app)/fund/[id]/sweep/+page.svelte b/src/routes/(app)/fund/[id]/sweep/+page.svelte index e142f00d..927c59d3 100644 --- a/src/routes/(app)/fund/[id]/sweep/+page.svelte +++ b/src/routes/(app)/fund/[id]/sweep/+page.svelte @@ -36,6 +36,6 @@
-
+
{$t("payments.tapAnywhere")}
diff --git a/src/routes/(app)/invoice/[id]/+layout@.svelte b/src/routes/(app)/invoice/[id]/+layout@.svelte index 74c3fd64..da801750 100644 --- a/src/routes/(app)/invoice/[id]/+layout@.svelte +++ b/src/routes/(app)/invoice/[id]/+layout@.svelte @@ -104,7 +104,7 @@ -
+
{#if !$loading} diff --git a/src/routes/(app)/invoice/[id]/+page.svelte b/src/routes/(app)/invoice/[id]/+page.svelte index 66503f95..1b4ef5c8 100644 --- a/src/routes/(app)/invoice/[id]/+page.svelte +++ b/src/routes/(app)/invoice/[id]/+page.svelte @@ -6,6 +6,8 @@ import { browser } from "$app/environment"; import { last, showQr, amountPrompt } from "$lib/store"; import Avatar from "$comp/Avatar.svelte"; + import InvoiceData from "$comp/InvoiceData.svelte"; + import InvoiceActions from "$comp/InvoiceActions.svelte"; import InvoiceTypes from "$comp/InvoiceTypes.svelte"; import SetAmount from "$comp/SetAmount.svelte"; import { t } from "$lib/translations"; @@ -120,106 +122,32 @@
- {#if $showQr} -
- - {txt} - -
- {/if} - - {#if type !== types.lightning || !$showQr} -
-
{txt}
-
- {/if} - - {#each invoice.items as i} -
-
{i.quantity}
-
- {i.name} -
-
- {f(i.price * i.quantity, currency)} -
-
- {sat(btc(i.price * i.quantity, rate))} -
-
- {/each} - - {#if amount > 0} -
-
- {f(amountFiat, currency)} - - {#if tip} - - +{f(tip * (rate / sats), currency)} - - {/if} -
-
- ⚡️{`${s(amount)}`} - - {#if tip} - - +⚡️{s(tip)} - - {/if} -
-
- {/if} - -
- - - {#if user?.id === invoice?.user?.id} - - {:else} - - - - {/if} - - {#if type === types.lightning} -
- -
- {/if} -
+ + +
diff --git a/src/routes/(app)/invoice/[id]/paid/+page.svelte b/src/routes/(app)/invoice/[id]/paid/+page.svelte index e4279e48..b3b6e71a 100644 --- a/src/routes/(app)/invoice/[id]/paid/+page.svelte +++ b/src/routes/(app)/invoice/[id]/paid/+page.svelte @@ -80,6 +80,6 @@
-
+
{$t("payments.tapAnywhere")}
diff --git a/src/routes/(app)/ln/withdrawal/sent/+page.svelte b/src/routes/(app)/ln/withdrawal/sent/+page.svelte index 90814960..143a92f4 100644 --- a/src/routes/(app)/ln/withdrawal/sent/+page.svelte +++ b/src/routes/(app)/ln/withdrawal/sent/+page.svelte @@ -23,6 +23,6 @@
-
+
{$t("payments.tapAnywhere")}
diff --git a/src/routes/(app)/pay/[username]/[...amount]/+page.svelte b/src/routes/(app)/pay/[username]/[...amount]/+page.svelte index 5089e78c..75e66a10 100644 --- a/src/routes/(app)/pay/[username]/[...amount]/+page.svelte +++ b/src/routes/(app)/pay/[username]/[...amount]/+page.svelte @@ -97,7 +97,7 @@
diff --git a/src/routes/(app)/sent/[id]/+page.svelte b/src/routes/(app)/sent/[id]/+page.svelte index a71a5360..b4f6ab68 100644 --- a/src/routes/(app)/sent/[id]/+page.svelte +++ b/src/routes/(app)/sent/[id]/+page.svelte @@ -41,6 +41,6 @@
-
+
{$t("payments.tapAnywhere")}
diff --git a/src/routes/(app)/verify/[code]/+page.svelte b/src/routes/(app)/verify/[code]/+page.svelte index 1e099dae..de5212e5 100644 --- a/src/routes/(app)/verify/[code]/+page.svelte +++ b/src/routes/(app)/verify/[code]/+page.svelte @@ -30,6 +30,6 @@
-
+
{$t("payments.tapAnywhere")}
diff --git a/src/routes/(static)/docs/+page.svelte b/src/routes/(static)/docs/+page.svelte index c65a29b0..f83ba8c0 100644 --- a/src/routes/(static)/docs/+page.svelte +++ b/src/routes/(static)/docs/+page.svelte @@ -26,19 +26,19 @@ and connect it to your own Bitcoin and Lightning nodes. The code is available for download at https://github.com/coinoshttps://github.com/coinos

Coinos has a simple REST API that can be used to register accounts and make payments and queries. The following examples show how you can call the API - with curl from your command + with curl from your command line.

API Base URL

-
+
{api}
$token to run the examples.

-
+
{tokenSample}