From e69768ba8e777fd0b2778aad73e17267870226ea Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 1 Dec 2023 20:04:13 -0800 Subject: prettier --- src/routes/(app)/payment/[id]/+page.server.js | 6 +- src/routes/(app)/payment/[id]/+page.svelte | 289 +++++++++++---------- .../(app)/payment/[id]/plain/+page.server.js | 6 +- src/routes/(app)/payment/[id]/plain/+page.svelte | 132 +++++----- src/routes/(app)/payment/[id]/print/+server.js | 8 +- 5 files changed, 233 insertions(+), 208 deletions(-) (limited to 'src/routes/(app)/payment') diff --git a/src/routes/(app)/payment/[id]/+page.server.js b/src/routes/(app)/payment/[id]/+page.server.js index 1c90ab69..5a364c65 100644 --- a/src/routes/(app)/payment/[id]/+page.server.js +++ b/src/routes/(app)/payment/[id]/+page.server.js @@ -1,6 +1,6 @@ -import { auth, get } from '$lib/utils'; +import { auth, get } from "$lib/utils"; export async function load({ cookies, params }) { - let payment = await get(`/payments/${params.id}`, auth(cookies)); - return { payment }; + let payment = await get(`/payments/${params.id}`, auth(cookies)); + return { payment }; } diff --git a/src/routes/(app)/payment/[id]/+page.svelte b/src/routes/(app)/payment/[id]/+page.svelte index 98c5a68b..7e3c6792 100644 --- a/src/routes/(app)/payment/[id]/+page.svelte +++ b/src/routes/(app)/payment/[id]/+page.svelte @@ -1,158 +1,173 @@ - +
-

- {$t(amount < 0 ? 'payments.sent' : 'payments.received')} -

+

+ {$t(amount < 0 ? "payments.sent" : "payments.received")} +

- {#if p.with} -
- {direction} - -
-
- -
-
{p.with.username}
-
-
-
- {/if} - {#if p.type === types.fund} -
- {direction} - -
-
- Pot -
-
{p.memo}
-
-
-
- {/if} -
- {$t('payments.amount')} -
- {f(fiat(a, rate), currency)} - - ⚡️{s(a)} - -
-
+ {#if p.with} +
+ {direction} + +
+
+ +
+
{p.with.username}
+
+
+
+ {/if} + {#if p.type === types.fund} +
+ {direction} + +
+
+ Pot +
+
{p.memo}
+
+
+
+ {/if} +
+ {$t("payments.amount")} +
+ {f(fiat(a, rate), currency)} + + ⚡️{s(a)} + +
+
- {#if tip} -
- {$t('invoice.tip')} -
- {f(fiat(tip, rate), currency)} - ({Math.round((tip * 100) / Math.abs(a))}%) - - ⚡️{s(tip)} - -
-
+ {#if tip} +
+ {$t("invoice.tip")} +
+ {f(fiat(tip, rate), currency)} + ({Math.round((tip * 100) / Math.abs(a))}%) + + ⚡️{s(tip)} + +
+
-
- Total -
- {f(fiat(a + (tip || 0), rate), currency)} - ⚡️{`${s(a + (tip || 0))}`} -
-
- {/if} +
+ Total +
+ {f(fiat(a + (tip || 0), rate), currency)} + ⚡️{`${s(a + (tip || 0))}`} +
+
+ {/if} -
- Network fee -
- {f(fiat(fee, rate), currency)} - ⚡️{`${s(fee)}`} -
-
+
+ Network fee +
+ {f(fiat(fee, rate), currency)} + ⚡️{`${s(fee)}`} +
+
- {#if ourfee > 0} -
- Platform fee -
- {f(fiat(ourfee, rate), currency)} - ⚡️{`${s(ourfee)}`} -
-
- {/if} + {#if ourfee > 0} +
+ Platform fee +
+ {f(fiat(ourfee, rate), currency)} + ⚡️{`${s(ourfee)}`} +
+
+ {/if} -
- Date -
- {format(new Date(created), 'MMMM d')}, - {format(new Date(created), 'h:mm aaa')} -
-
+
+ Date +
+ {format(new Date(created), "MMMM d")}, + {format(new Date(created), "h:mm aaa")} +
+
- {#if type === 'bitcoin'} -
- Txid -
-
- {id} -
- -
-
- {/if} + {#if type === "bitcoin"} +
+ Txid +
+
+ {id} +
+ +
+
+ {/if} - {#if user.hasprinter} -
- -
- {:else} -
- - - -
- {/if} + {#if user.hasprinter} +
+ +
+ {:else} +
+ + + +
+ {/if}
diff --git a/src/routes/(app)/payment/[id]/plain/+page.server.js b/src/routes/(app)/payment/[id]/plain/+page.server.js index 1c90ab69..5a364c65 100644 --- a/src/routes/(app)/payment/[id]/plain/+page.server.js +++ b/src/routes/(app)/payment/[id]/plain/+page.server.js @@ -1,6 +1,6 @@ -import { auth, get } from '$lib/utils'; +import { auth, get } from "$lib/utils"; export async function load({ cookies, params }) { - let payment = await get(`/payments/${params.id}`, auth(cookies)); - return { payment }; + let payment = await get(`/payments/${params.id}`, auth(cookies)); + return { payment }; } diff --git a/src/routes/(app)/payment/[id]/plain/+page.svelte b/src/routes/(app)/payment/[id]/plain/+page.svelte index 5ffd1656..27e8d0ed 100644 --- a/src/routes/(app)/payment/[id]/plain/+page.svelte +++ b/src/routes/(app)/payment/[id]/plain/+page.svelte @@ -1,77 +1,87 @@
-
- Amount -
- {f(fiat(a, rate), currency)} -
-
+
+ Amount +
+ {f(fiat(a, rate), currency)} +
+
- {#if tip} -
- Tip -
- {f(fiat(tip, rate), currency)} - ({Math.round((tip * 100) / Math.abs(a))}%) -
-
+ {#if tip} +
+ Tip +
+ {f(fiat(tip, rate), currency)} + ({Math.round((tip * 100) / Math.abs(a))}%) +
+
-
- Total -
- {f(fiat(a + (tip || 0), rate), currency)} -
-
- {/if} +
+ Total +
+ {f(fiat(a + (tip || 0), rate), currency)} +
+
+ {/if} -
- Date -
- {format(new Date(created), 'MMMM d')}, - {format(new Date(created), 'h:mm aaa')} -
-
+
+ Date +
+ {format(new Date(created), "MMMM d")}, + {format(new Date(created), "h:mm aaa")} +
+
- {#if type === 'bitcoin'} -
- Txid -
-
- {id} -
-
-
- {/if} + {#if type === "bitcoin"} +
+ Txid +
+
+ {id} +
+
+
+ {/if}
-
+
diff --git a/src/routes/(app)/payment/[id]/print/+server.js b/src/routes/(app)/payment/[id]/print/+server.js index fde834d1..2fdfc8c1 100644 --- a/src/routes/(app)/payment/[id]/print/+server.js +++ b/src/routes/(app)/payment/[id]/print/+server.js @@ -1,7 +1,7 @@ -import { auth, post } from '$lib/utils'; -import { json } from '@sveltejs/kit'; +import { auth, post } from "$lib/utils"; +import { json } from "@sveltejs/kit"; export async function POST({ cookies, request }) { - let body = await request.json(); - return json(post('/print', body, auth(cookies))); + let body = await request.json(); + return json(post("/print", body, auth(cookies))); } -- cgit v1.2.3