diff options
| author | Adam Soltys <[email protected]> | 2022-10-03 23:13:49 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-10-03 23:13:49 -0700 |
| commit | 63f1a6780bab85ebb48ca1fc142cc6beaf772faa (patch) | |
| tree | b498ac8dd1a8ac5ffd517e6a8050399d9d7a86a1 /src/routes/invoice | |
| parent | 8906099f391acf19f7b8eb91527b027cedd65b5e (diff) | |
| download | coinos-ui-63f1a6780bab85ebb48ca1fc142cc6beaf772faa.tar.gz coinos-ui-63f1a6780bab85ebb48ca1fc142cc6beaf772faa.zip | |
refactoring
Diffstat (limited to 'src/routes/invoice')
| -rw-r--r-- | src/routes/invoice/+server.js | 10 | ||||
| -rw-r--r-- | src/routes/invoice/[id]/+page.svelte | 20 |
2 files changed, 10 insertions, 20 deletions
diff --git a/src/routes/invoice/+server.js b/src/routes/invoice/+server.js index 5b2f2b39..e69de29b 100644 --- a/src/routes/invoice/+server.js +++ b/src/routes/invoice/+server.js @@ -1,10 +0,0 @@ -import { auth, get, post } from '$lib/utils'; - -export async function POST({ cookies, request }) { - let { amount, currency, network = 'lightning', prompt, rate, tip, user } = await request.json(); - let invoice = { amount, currency, network, prompt, rate, tip }; - - return new Response(JSON.stringify(await post('/invoice', { invoice, user }, auth(cookies))), { - headers: { 'content-type': 'application/json' } - }); -} diff --git a/src/routes/invoice/[id]/+page.svelte b/src/routes/invoice/[id]/+page.svelte index 7ff63862..9e0f9654 100644 --- a/src/routes/invoice/[id]/+page.svelte +++ b/src/routes/invoice/[id]/+page.svelte @@ -1,14 +1,14 @@ <script> - import { copy, f, get, reverseFormat, s, toggleFullscreen, sats } from '$lib/utils'; + import { copy, f, get, reverseFormat, s, sats } from '$lib/utils'; import { browser } from '$app/environment'; - import { invoices, user } from '$lib/store'; + import { invoices } from '$lib/store'; import { Icon, Heart, Image, Qr, Tip } from '$comp'; import { goto } from '$app/navigation'; import { t } from '$lib/translations'; export let data; $: refresh(data); - let { invoice, id } = data; + let { invoice, id, user } = data; let { amount, rate, @@ -25,6 +25,8 @@ let qr; let tipPercent = 0; + let fullscreen; + let refresh = (data) => { ({ invoice, id } = data); ({ @@ -57,7 +59,7 @@ <div class:full-shadow={showMobileTip}> <button class="ml-5 md:ml-20 mt-5 md:mt-10 hover:opacity-80" - class:invisible={!$user} + class:invisible={!user} disabled={showMobileTip} on:click={() => goto(`/${username}/receive`)} > @@ -109,12 +111,10 @@ <div> <button - class="border border-lightgrey rounded-md p-2 mx-2 hover:opacity-80" - on:click={() => toggleFullscreen(qr)}><Icon icon="expand" /></button - > - <button - class="border border-lightgrey rounded-md p-2 mx-2 hover:opacity-80" - on:click={() => copy(text)}><Icon icon="copy" /></button + class="flex rounded-full border py-2 px-5 font-bold hover:opacity-80 mb-2 mx-auto" + on:click={() => copy(text)} + ><Icon icon="copy" style="mr-1" /> + <div>Copy</div></button > </div> |
