diff options
| author | Adam Soltys <[email protected]> | 2023-05-21 22:00:53 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-05-21 22:00:53 -0700 |
| commit | ba9f06dfdbde4eb51f1a25a1f68a0e6c8a3c5e2e (patch) | |
| tree | 6204d8235672452e29c2acf71a9561f7423e153c /src/routes | |
| parent | fcaf3085acc140443c32a616b5f8ee3a7edf8a90 (diff) | |
| download | coinos-ui-ba9f06dfdbde4eb51f1a25a1f68a0e6c8a3c5e2e.tar.gz coinos-ui-ba9f06dfdbde4eb51f1a25a1f68a0e6c8a3c5e2e.zip | |
pot sweep function
Diffstat (limited to 'src/routes')
| -rw-r--r-- | src/routes/(app)/pot/[name]/+page.svelte | 12 | ||||
| -rw-r--r-- | src/routes/(app)/pot/[name]/sweep/+page.server.js | 13 | ||||
| -rw-r--r-- | src/routes/(app)/pot/[name]/sweep/+page.svelte | 38 |
3 files changed, 57 insertions, 6 deletions
diff --git a/src/routes/(app)/pot/[name]/+page.svelte b/src/routes/(app)/pot/[name]/+page.svelte index d3f559a1..aac70e8e 100644 --- a/src/routes/(app)/pot/[name]/+page.svelte +++ b/src/routes/(app)/pot/[name]/+page.svelte @@ -94,12 +94,12 @@ <Icon icon="qr" style="invert" /> {show ? 'Hide' : 'Show'} QR </button> - <button - class="rounded-full border py-3 px-2 font-bold hover:opacity-80 flex gap-1 w-full justify-center" - > - <Icon icon="nfc" style="w-6" /> - Write Tag - </button> + <!-- <button --> + <!-- class="rounded-full border py-3 px-2 font-bold hover:opacity-80 flex gap-1 w-full justify-center" --> + <!-- > --> + <!-- <Icon icon="nfc" style="w-6" /> --> + <!-- Write Tag --> + <!-- </button> --> </div> <div class="text-base"> {#each payments as p} diff --git a/src/routes/(app)/pot/[name]/sweep/+page.server.js b/src/routes/(app)/pot/[name]/sweep/+page.server.js new file mode 100644 index 00000000..dc6d17c1 --- /dev/null +++ b/src/routes/(app)/pot/[name]/sweep/+page.server.js @@ -0,0 +1,13 @@ +import { get, auth, post } from '$lib/utils'; +import { redirect } from '@sveltejs/kit'; + +export async function load({ cookies, params, parent }) { + let { user } = await parent(); + let { name } = params; + let { amount } = await get(`/pot/${name}`); + + + if (!user) throw redirect(307, `/register?redirect=/pot/${name}/sweep`); + // await post('/take', { amount, name }, auth(cookies)); + return { amount, name }; +} diff --git a/src/routes/(app)/pot/[name]/sweep/+page.svelte b/src/routes/(app)/pot/[name]/sweep/+page.svelte new file mode 100644 index 00000000..17d707cc --- /dev/null +++ b/src/routes/(app)/pot/[name]/sweep/+page.svelte @@ -0,0 +1,38 @@ +<script> + import { scale } from 'svelte/transition'; + import { fiat, f, s } from '$lib/utils'; + import { Icon } from '$comp'; + import { t } from '$lib/translations'; + + export let data; + + let { amount, name, user, rates } = data; + let { currency } = user; + $: rate = rates[currency]; +</script> + + +<div class="container px-4 max-w-xl mx-auto mt-10 space-y-5 text-center"> + <div class="w-full flex"> + <a href="/" class="mx-auto"> + <Icon icon="logo" /> + </a> + </div> + + <div class="flex w-full py-5 max-w-[200px] mx-auto" in:scale={{ start: 0.5 }}> + <Icon icon="check" style="mx-auto" /> + </div> + <h1 class="text-3xl md:text-4xl font-bold mb-6">{$t('payments.fundsClaimed')}</h1> + <h2 class="text-2xl md:text-3xl font-semibold"> + {f(fiat(amount, rate), currency)} + </h2> + <h3 class="text-secondary md:text-lg mb-6 mt-1"> + ⚡️{s(amount)} + </h3> + </div> + +<a href={`/${user.username}/payments`}> + <div class="opacity-0 w-screen h-screen fixed top-0 left-0 z-50" /> +</a> + +<div class="fixed bottom-10 w-full text-center">{$t('payments.tapAnywhere')}</div> |
