diff options
| author | Adam Soltys <[email protected]> | 2022-09-24 13:34:37 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-09-25 21:34:59 -0700 |
| commit | 7bfd57b8b249fcf8ab87b52c8a4416d62f3cd1f6 (patch) | |
| tree | ed85daeb18785e450fc4cb2e67066809cd0a1956 /src/routes/launch/purchase | |
| parent | e0e4441cfa2b20c3f5f0126a5cf8aeddaed269b6 (diff) | |
| download | coinos-ui-7bfd57b8b249fcf8ab87b52c8a4416d62f3cd1f6.tar.gz coinos-ui-7bfd57b8b249fcf8ab87b52c8a4416d62f3cd1f6.zip | |
wip
Diffstat (limited to 'src/routes/launch/purchase')
| -rw-r--r-- | src/routes/launch/purchase/+page.svelte | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/src/routes/launch/purchase/+page.svelte b/src/routes/launch/purchase/+page.svelte new file mode 100644 index 00000000..c6777349 --- /dev/null +++ b/src/routes/launch/purchase/+page.svelte @@ -0,0 +1,79 @@ +<script> + import { selectedRate } from '$lib/store'; + import { post } from '$lib/utils'; + export let data; + + let amount = 35000; + let { + account: { address, balance }, + address, + username + } = data.user; + + let invoice; + let get = async (network) => { + invoice = await post('/invoice', { + amount, + address, + rate: $selectedRate, + network, + username + }); + }; + + let lightning = () => get('lightning'); + let bitcoin = () => get('bitcoin'); + + // if (balance < amount) throw redirect(307, `/${username}/fund/${amount - balance}`); +</script> + +<div class="mx-auto h-screen flex items-center justify-center px-8"> + <div class="flex w-full bg-white rounded shadow-lg"> + <div class="p-4 font-normal text-gray-800 mx-auto mb-8"> + {#if balance > amount} + <h1 class="mb-4 text-4xl font-bold leading-none tracking-tight text-gray-800 text-center"> + Buy Your Launch Party Ticket? + </h1> + + <div class="text-center text-4xl mb-12">{amount} sats</div> + + <div class="w-full flex"> + <button + class="bg-black text-white border rounded-full px-8 py-4 font-bold hover:opacity-80 mx-auto text-2xl" + > + Count me in + </button> + </div> + {:else} + <h1 class="mb-4 text-4xl font-bold leading-none tracking-tight text-gray-800 text-center"> + Ticket Price + </h1> + <div class="text-center text-4xl mb-12">{amount} sats</div> + + <h1 class="mb-4 text-4xl font-bold leading-none tracking-tight text-gray-800 text-center"> + Your Balance + </h1> + + <div class="text-center text-4xl mb-12">{balance} sats</div> + + <h1 class="mb-4 text-4xl font-bold leading-none tracking-tight text-gray-800 text-center"> + Funding Options + </h1> + + <button + class="bg-black text-white border rounded-full px-8 py-4 font-bold hover:opacity-80 mx-auto text-2xl" + on:click={lightning} + > + Lightning + </button> + + <button + class="bg-black text-white border rounded-full px-8 py-4 font-bold hover:opacity-80 mx-auto text-2xl" + on:click={bitcoin} + > + Bitcoin + </button> + {/if} + </div> + </div> +</div> |
