From 7bd39ca6f942c146a6e21be625c03bef84c1d3ee Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sun, 30 Oct 2022 22:11:10 -0700 Subject: revamped tip prompt --- src/routes/[username]/receive/+page.svelte | 3 +- src/routes/invoice/[id]/+page.svelte | 44 +---- src/routes/invoice/[id]/tip/+page.server.js | 5 + src/routes/invoice/[id]/tip/+page.svelte | 261 ++++++++++++++++++++++++++++ 4 files changed, 272 insertions(+), 41 deletions(-) create mode 100644 src/routes/invoice/[id]/tip/+page.server.js create mode 100644 src/routes/invoice/[id]/tip/+page.svelte (limited to 'src/routes') diff --git a/src/routes/[username]/receive/+page.svelte b/src/routes/[username]/receive/+page.svelte index 7b0562d5..7425740a 100644 --- a/src/routes/[username]/receive/+page.svelte +++ b/src/routes/[username]/receive/+page.svelte @@ -24,8 +24,7 @@ : 'opacity-100 hover:opacity-80'}" disabled={!amount} > - - {$t('user.receive.showQR')} + Next diff --git a/src/routes/invoice/[id]/+page.svelte b/src/routes/invoice/[id]/+page.svelte index 84b03593..7dd6d51c 100644 --- a/src/routes/invoice/[id]/+page.svelte +++ b/src/routes/invoice/[id]/+page.svelte @@ -1,5 +1,5 @@ -
+
@@ -69,40 +61,14 @@
- {#if invoice.prompt} - - {/if} - -
- - - Scan to pay {username} - +
diff --git a/src/routes/invoice/[id]/tip/+page.server.js b/src/routes/invoice/[id]/tip/+page.server.js new file mode 100644 index 00000000..1068f273 --- /dev/null +++ b/src/routes/invoice/[id]/tip/+page.server.js @@ -0,0 +1,5 @@ +import invoice from '$lib/invoice'; + +export const actions = { + default: invoice +}; diff --git a/src/routes/invoice/[id]/tip/+page.svelte b/src/routes/invoice/[id]/tip/+page.svelte new file mode 100644 index 00000000..26eeba31 --- /dev/null +++ b/src/routes/invoice/[id]/tip/+page.svelte @@ -0,0 +1,261 @@ + + + + +
+
+ + + + + + +

{$t('invoice.addTipq')}

+ {#if !showCustomAmount} +
{Math.round(tipPercent)}%
+ + + +
+
+ + {f(amountFiat, currency)} + +{f(tipAmount, currency)} +
+ +
+ {s(amount)} + +{s(tip)} SAT +
+
+ + {#if tip} +
+ + +
+ {:else} + {#each tipAmounts as amount} + + {/each} + {/if} + +
+ +
+ {/if} + +
+
+ + {/if} +
+ + -- cgit v1.2.3