aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/launch
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-12-01 20:04:13 -0800
committerAdam Soltys <[email protected]>2023-12-01 20:04:13 -0800
commit216a600224fde22ce76b367557a02094ec693886 (patch)
treed1189bbaa39db204633523132a7d4767b952717d /src/routes/(app)/launch
parent7d9bc1f54dfd04172e8d6d43ebc2efd6f407e833 (diff)
downloadcoinos-ui-216a600224fde22ce76b367557a02094ec693886.tar.gz
coinos-ui-216a600224fde22ce76b367557a02094ec693886.zip
prettier
Diffstat (limited to 'src/routes/(app)/launch')
-rw-r--r--src/routes/(app)/launch/+page.server.js6
-rw-r--r--src/routes/(app)/launch/+page.svelte187
-rw-r--r--src/routes/(app)/launch/purchase/+page.server.js68
-rw-r--r--src/routes/(app)/launch/purchase/+page.svelte114
-rw-r--r--src/routes/(app)/launch/purchase/card/+page.server.js72
-rw-r--r--src/routes/(app)/launch/purchase/card/+page.svelte134
-rw-r--r--src/routes/(app)/launch/thanks/[asset]/+page.svelte40
-rw-r--r--src/routes/(app)/launch/ticket/+page.server.js14
-rw-r--r--src/routes/(app)/launch/ticket/+page.svelte56
9 files changed, 366 insertions, 325 deletions
diff --git a/src/routes/(app)/launch/+page.server.js b/src/routes/(app)/launch/+page.server.js
index 2b44dfae..d11af500 100644
--- a/src/routes/(app)/launch/+page.server.js
+++ b/src/routes/(app)/launch/+page.server.js
@@ -1,6 +1,6 @@
-import { auth, get } from '$lib/utils';
+import { auth, get } from "$lib/utils";
export const load = async ({ parent }) => {
- let tickets = await get('/tickets');
- return { ...(await parent()), tickets };
+ let tickets = await get("/tickets");
+ return { ...(await parent()), tickets };
};
diff --git a/src/routes/(app)/launch/+page.svelte b/src/routes/(app)/launch/+page.svelte
index 3469f0bc..028274fa 100644
--- a/src/routes/(app)/launch/+page.svelte
+++ b/src/routes/(app)/launch/+page.svelte
@@ -1,103 +1,118 @@
<script>
- import { LandingHeader } from '$comp';
- import { loginRedirect } from '$lib/store';
- import { beforeNavigate } from '$app/navigation';
- import { info } from '$lib/utils';
- import { Icon } from '$comp';
- import { t } from '$lib/translations';
- import { goto } from '$app/navigation';
- import { scroll } from '$lib/utils';
+ import { LandingHeader } from "$comp";
+ import { loginRedirect } from "$lib/store";
+ import { beforeNavigate } from "$app/navigation";
+ import { info } from "$lib/utils";
+ import { Icon } from "$comp";
+ import { t } from "$lib/translations";
+ import { goto } from "$app/navigation";
+ import { scroll } from "$lib/utils";
- export let data;
- let { user, tickets } = data;
- $loginRedirect = '/launch/purchase';
+ export let data;
+ let { user, tickets } = data;
+ $loginRedirect = "/launch/purchase";
- let hasTicket = !!user?.accounts.find((a) => tickets.includes(a.asset));
- $: link = hasTicket ? '/launch/ticket' : user ? $loginRedirect : '/register';
- $: text = (hasTicket ? 'View' : 'Purchase') + ' Ticket';
+ let hasTicket = !!user?.accounts.find((a) => tickets.includes(a.asset));
+ $: link = hasTicket ? "/launch/ticket" : user ? $loginRedirect : "/register";
+ $: text = (hasTicket ? "View" : "Purchase") + " Ticket";
- beforeNavigate(({ to }) => {
- if (to?.routeId === 'register') info('Please sign in so we can get you a ticket');
- });
+ beforeNavigate(({ to }) => {
+ if (to?.routeId === "register")
+ info("Please sign in so we can get you a ticket");
+ });
- let showMobileMenu = false;
- const mobileMenuButtonClick = (section) => {
- showMobileMenu = false;
- scroll(section);
- };
+ let showMobileMenu = false;
+ const mobileMenuButtonClick = (section) => {
+ showMobileMenu = false;
+ scroll(section);
+ };
</script>
-<header class="w-full lg:w-5/6 py-5 mx-auto fixed md:sticky z-10 top-0 bg-white/90">
- <nav class="block xl:flex flex-wrap justify-between items-center">
- <div class="flex justify-start md:justify-center items-center md:space-x-10">
- <a href="/" class="hidden md:block">
- <Icon icon="logo" style="mb-5 xl:mb-0" />
- </a>
- <Icon icon="logo" style="block md:hidden ml-5 w-48" />
- </div>
- </nav>
+<header
+ class="w-full lg:w-5/6 py-5 mx-auto fixed md:sticky z-10 top-0 bg-white/90"
+>
+ <nav class="block xl:flex flex-wrap justify-between items-center">
+ <div
+ class="flex justify-start md:justify-center items-center md:space-x-10"
+ >
+ <a href="/" class="hidden md:block">
+ <Icon icon="logo" style="mb-5 xl:mb-0" />
+ </a>
+ <Icon icon="logo" style="block md:hidden ml-5 w-48" />
+ </div>
+ </nav>
</header>
<div class="mx-auto flex items-center justify-center px-8 mt-20">
- <div class="flex flex-col w-full bg-white rounded shadow-lg sm:w-3/4 lg:w-3/5">
- <div class="flex flex-col w-full md:flex-row">
- <div
- class="flex flex-row justify-around p-4 font-bold leading-none text-gray-800 uppercase bg-gray-400 rounded md:flex-col md:items-center md:justify-center md:w-1/4"
- >
- <div class="md:text-3xl">Oct</div>
- <div class="md:text-6xl">26</div>
- <div class="md:text-xl">6 pm</div>
- </div>
- <div class="p-4 font-normal text-gray-800 md:w-3/4 space-y-5">
- <h1 class="mb-4 text-4xl font-bold leading-none tracking-tight text-gray-800">
- Launch Party!
- </h1>
+ <div
+ class="flex flex-col w-full bg-white rounded shadow-lg sm:w-3/4 lg:w-3/5"
+ >
+ <div class="flex flex-col w-full md:flex-row">
+ <div
+ class="flex flex-row justify-around p-4 font-bold leading-none text-gray-800 uppercase bg-gray-400 rounded md:flex-col md:items-center md:justify-center md:w-1/4"
+ >
+ <div class="md:text-3xl">Oct</div>
+ <div class="md:text-6xl">26</div>
+ <div class="md:text-xl">6 pm</div>
+ </div>
+ <div class="p-4 font-normal text-gray-800 md:w-3/4 space-y-5">
+ <h1
+ class="mb-4 text-4xl font-bold leading-none tracking-tight text-gray-800"
+ >
+ Launch Party!
+ </h1>
- <p class="leading-normal mb-2">
- Come join us at our launch party celebrating our new design and 10 years serving the
- Vancouver Bitcoin community!
- </p>
+ <p class="leading-normal mb-2">
+ Come join us at our launch party celebrating our new design and 10
+ years serving the Vancouver Bitcoin community!
+ </p>
- <div class="flex">
- <div class="space-y-5">
- <div class="ml-8">
- <p><b>When</b></p>
- <p>6pm October 26</p>
- </div>
- <div class="ml-8">
- <p><b>Where</b></p>
- <p>The Loft Lounge</p>
- <p>1184 Denman Street, #203</p>
- <p>Vancouver, BC</p>
- </div>
- </div>
+ <div class="flex">
+ <div class="space-y-5">
+ <div class="ml-8">
+ <p><b>When</b></p>
+ <p>6pm October 26</p>
+ </div>
+ <div class="ml-8">
+ <p><b>Where</b></p>
+ <p>The Loft Lounge</p>
+ <p>1184 Denman Street, #203</p>
+ <p>Vancouver, BC</p>
+ </div>
+ </div>
- <img src="/icons/party.svg" alt="Partygoers" class="w-[120px] mx-auto" />
- </div>
+ <img
+ src="/icons/party.svg"
+ alt="Partygoers"
+ class="w-[120px] mx-auto"
+ />
+ </div>
- <p>
- We'll introduce our new interface and then network and enjoy tasty food and drinks from <a
- href="https://loftondenman.com/"
- class="underline">The Loft</a
- >!
- </p>
+ <p>
+ We'll introduce our new interface and then network and enjoy tasty
+ food and drinks from <a
+ href="https://loftondenman.com/"
+ class="underline">The Loft</a
+ >!
+ </p>
- <p>
- The Loft will be accepting Lightning payments at the event and going forward into the
- future as well! We're charging $6 for for an NFT ticket that gets you entry, appies, and
- the chance to win some swag and sats.
- </p>
+ <p>
+ The Loft will be accepting Lightning payments at the event and going
+ forward into the future as well! We're charging $6 for for an NFT
+ ticket that gets you entry, appies, and the chance to win some swag
+ and sats.
+ </p>
- <div class="flex w-full my-8">
- <a href={link} class="mx-auto">
- <button
- class="bg-white text-black border rounded-full px-8 py-4 font-bold hover:opacity-80 text-2xl"
- >
- {text}
- </button>
- </a>
- </div>
- </div>
- </div>
- </div>
+ <div class="flex w-full my-8">
+ <a href={link} class="mx-auto">
+ <button
+ class="bg-white text-black border rounded-full px-8 py-4 font-bold hover:opacity-80 text-2xl"
+ >
+ {text}
+ </button>
+ </a>
+ </div>
+ </div>
+ </div>
+ </div>
</div>
diff --git a/src/routes/(app)/launch/purchase/+page.server.js b/src/routes/(app)/launch/purchase/+page.server.js
index a3043d9c..58669606 100644
--- a/src/routes/(app)/launch/purchase/+page.server.js
+++ b/src/routes/(app)/launch/purchase/+page.server.js
@@ -1,45 +1,49 @@
-import { auth, get, post } from '$lib/utils';
-import tickets from '$lib/tickets';
-import { redirect } from '@sveltejs/kit';
-import { env } from '$env/dynamic/private';
-import { invalidateAll } from '$app/navigation';
-import { browser } from '$app/environment';
-import { createTicket } from '$lib/ticket';
+import { auth, get, post } from "$lib/utils";
+import tickets from "$lib/tickets";
+import { redirect } from "@sveltejs/kit";
+import { env } from "$env/dynamic/private";
+import { invalidateAll } from "$app/navigation";
+import { browser } from "$app/environment";
+import { createTicket } from "$lib/ticket";
export const load = async ({ parent }) => {
- let tickets = await get('/tickets');
- let { user } = await parent();
- let hasTicket = !!user?.accounts.find((a) => tickets.includes(a.asset));
- if (hasTicket) throw redirect(307, '/launch/ticket');
- return { tickets };
+ let tickets = await get("/tickets");
+ let { user } = await parent();
+ let hasTicket = !!user?.accounts.find((a) => tickets.includes(a.asset));
+ if (hasTicket) throw redirect(307, "/launch/ticket");
+ return { tickets };
};
export const actions = {
- internal: async ({ cookies, request }) => {
- let form = await request.formData();
- let asset = await createTicket(cookies, form.get('username'));
- await post('/payments', { amount: 22000, username: 'launch' }, auth(cookies));
+ internal: async ({ cookies, request }) => {
+ let form = await request.formData();
+ let asset = await createTicket(cookies, form.get("username"));
+ await post(
+ "/payments",
+ { amount: 22000, username: "launch" },
+ auth(cookies)
+ );
- throw redirect(307, `/launch/thanks/${asset}`);
- },
+ throw redirect(307, `/launch/thanks/${asset}`);
+ },
- lightning: async ({ cookies, request }) => {
- let form = await request.formData();
+ lightning: async ({ cookies, request }) => {
+ let form = await request.formData();
- let rates = await get('/rates');
+ let rates = await get("/rates");
- let invoice = {
- amount: 22000,
- memo: 'launch',
- type: 'lightning',
- prompt: false,
- rate: rates[form.get('currency')]
- };
+ let invoice = {
+ amount: 22000,
+ memo: "launch",
+ type: "lightning",
+ prompt: false,
+ rate: rates[form.get("currency")],
+ };
- let user = { username: form.get('username') };
+ let user = { username: form.get("username") };
- let { id } = await post('/invoice', { invoice, user }, auth(cookies));
+ let { id } = await post("/invoice", { invoice, user }, auth(cookies));
- throw redirect(307, `/${user.username}/invoice/${id}`);
- }
+ throw redirect(307, `/${user.username}/invoice/${id}`);
+ },
};
diff --git a/src/routes/(app)/launch/purchase/+page.svelte b/src/routes/(app)/launch/purchase/+page.svelte
index fbaa58c0..49a51973 100644
--- a/src/routes/(app)/launch/purchase/+page.svelte
+++ b/src/routes/(app)/launch/purchase/+page.svelte
@@ -1,66 +1,74 @@
<script>
- import { onMount } from 'svelte';
- import { enhance } from '$app/forms';
- import { post } from '$lib/utils';
- import { goto } from '$app/navigation';
+ import { onMount } from "svelte";
+ import { enhance } from "$app/forms";
+ import { post } from "$lib/utils";
+ import { goto } from "$app/navigation";
- export let data;
+ export let data;
- let amount = 22000;
- let {
- currency,
- account: { balance },
- username
- } = data.user;
+ let amount = 22000;
+ let {
+ currency,
+ account: { balance },
+ username,
+ } = data.user;
- let { tickets } = data;
- let ticket = tickets.length;
+ let { tickets } = data;
+ let ticket = tickets.length;
</script>
<div class="mx-auto h-screen flex items-center justify-center px-4">
- <div class="font-normal text-gray-800 mx-auto mb-8 space-y-8">
- <h1 class="mb-4 text-4xl font-bold leading-none tracking-tight text-gray-800 text-center">
- Purchase Ticket
- </h1>
+ <div class="font-normal text-gray-800 mx-auto mb-8 space-y-8">
+ <h1
+ class="mb-4 text-4xl font-bold leading-none tracking-tight text-gray-800 text-center"
+ >
+ Purchase Ticket
+ </h1>
- <img
- src={`/tickets/${(ticket + 1).toString().padStart(2, '0')}.png`}
- class="w-full max-w-[800px]"
- alt="Ticket"
- />
+ <img
+ src={`/tickets/${(ticket + 1).toString().padStart(2, "0")}.png`}
+ class="w-full max-w-[800px]"
+ alt="Ticket"
+ />
- {#if balance >= amount}
- <form action="?/internal" method="POST" use:enhance>
- <input type="hidden" name="username" value={username} />
+ {#if balance >= amount}
+ <form action="?/internal" method="POST" use:enhance>
+ <input type="hidden" name="username" value={username} />
- <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>
- </form>
- {:else}
- <h1 class="mb-4 text-xl font-bold leading-none tracking-tight text-gray-800 text-center">
- Payment Options
- </h1>
+ <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>
+ </form>
+ {:else}
+ <h1
+ class="mb-4 text-xl font-bold leading-none tracking-tight text-gray-800 text-center"
+ >
+ Payment Options
+ </h1>
- <div class="flex justify-center gap-4">
- <form action="?/lightning" method="POST">
- <input type="hidden" name="currency" value={currency} />
- <input type="hidden" name="username" value={username} />
- <button class="border rounded-full px-8 py-4 font-bold hover:opacity-80 mx-auto text-2xl">
- Lightning
- </button>
- </form>
+ <div class="flex justify-center gap-4">
+ <form action="?/lightning" method="POST">
+ <input type="hidden" name="currency" value={currency} />
+ <input type="hidden" name="username" value={username} />
+ <button
+ class="border rounded-full px-8 py-4 font-bold hover:opacity-80 mx-auto text-2xl"
+ >
+ Lightning
+ </button>
+ </form>
- <a href={`purchase/card`}>
- <button class="border rounded-full px-8 py-4 font-bold hover:opacity-80 mx-auto text-2xl">
- Credit Card
- </button>
- </a>
- </div>
- {/if}
- </div>
+ <a href={`purchase/card`}>
+ <button
+ class="border rounded-full px-8 py-4 font-bold hover:opacity-80 mx-auto text-2xl"
+ >
+ Credit Card
+ </button>
+ </a>
+ </div>
+ {/if}
+ </div>
</div>
diff --git a/src/routes/(app)/launch/purchase/card/+page.server.js b/src/routes/(app)/launch/purchase/card/+page.server.js
index 1f564f78..bca601d3 100644
--- a/src/routes/(app)/launch/purchase/card/+page.server.js
+++ b/src/routes/(app)/launch/purchase/card/+page.server.js
@@ -1,44 +1,52 @@
-import { env } from '$env/dynamic/private';
-import { error, redirect } from '@sveltejs/kit';
-import { post, auth } from '$lib/utils';
-import { createTicket } from '$lib/ticket';
+import { env } from "$env/dynamic/private";
+import { error, redirect } from "@sveltejs/kit";
+import { post, auth } from "$lib/utils";
+import { createTicket } from "$lib/ticket";
-let stripe = 'https://api.stripe.com/v1';
+let stripe = "https://api.stripe.com/v1";
export const actions = {
- default: async ({ cookies, request }) => {
- let form = await request.formData();
+ default: async ({ cookies, request }) => {
+ let form = await request.formData();
- let headers = new Headers();
- headers.set('Authorization', 'Basic ' + new Buffer(env.STRIPE + ':').toString('base64'));
+ let headers = new Headers();
+ headers.set(
+ "Authorization",
+ "Basic " + new Buffer(env.STRIPE + ":").toString("base64")
+ );
- let body = new URLSearchParams({
- 'card[number]': form.get('number').replace(/\s+/g, ''),
- 'card[exp_month]': form.get('expiry').slice(0, 2),
- 'card[exp_year]': form.get('expiry').slice(-2),
- 'card[cvc]': form.get('cvc')
- });
+ let body = new URLSearchParams({
+ "card[number]": form.get("number").replace(/\s+/g, ""),
+ "card[exp_month]": form.get("expiry").slice(0, 2),
+ "card[exp_year]": form.get("expiry").slice(-2),
+ "card[cvc]": form.get("cvc"),
+ });
- let method = 'POST';
+ let method = "POST";
- let { id: source } = await fetch(`${stripe}/tokens`, { body, headers, method }).then((r) =>
- r.json()
- );
+ let { id: source } = await fetch(`${stripe}/tokens`, {
+ body,
+ headers,
+ method,
+ }).then((r) => r.json());
- body = new URLSearchParams({
- amount: 600,
- currency: 'cad',
- source,
- description: 'launch ticket'
- });
+ body = new URLSearchParams({
+ amount: 600,
+ currency: "cad",
+ source,
+ description: "launch ticket",
+ });
- let { status } = await fetch(`${stripe}/charges`, { body, headers, method }).then((r) =>
- r.json()
- );
+ let { status } = await fetch(`${stripe}/charges`, {
+ body,
+ headers,
+ method,
+ }).then((r) => r.json());
- if (status !== 'succeeded') throw error(500, { message: 'Card payment failed' });
- let asset = await createTicket(cookies, form.get('username'));
+ if (status !== "succeeded")
+ throw error(500, { message: "Card payment failed" });
+ let asset = await createTicket(cookies, form.get("username"));
- throw redirect(307, `/launch/thanks/${asset}`);
- }
+ throw redirect(307, `/launch/thanks/${asset}`);
+ },
};
diff --git a/src/routes/(app)/launch/purchase/card/+page.svelte b/src/routes/(app)/launch/purchase/card/+page.svelte
index 05d09025..037a65b2 100644
--- a/src/routes/(app)/launch/purchase/card/+page.svelte
+++ b/src/routes/(app)/launch/purchase/card/+page.svelte
@@ -1,77 +1,77 @@
<script>
- import { enhance } from '$app/forms';
- import { Lock, Card, Calendar, Spinner } from '$comp';
+ import { enhance } from "$app/forms";
+ import { Lock, Card, Calendar, Spinner } from "$comp";
- export let data;
+ export let data;
- let { username } = data.user;
- let loading;
+ let { username } = data.user;
+ let loading;
</script>
<div class="container max-w-lg px-4 mx-auto space-y-5">
- <form
- method="POST"
- class="flex flex-wrap gap-5 w-full p-5 mt-20"
- use:enhance={() => {
- loading = true;
- return ({ update }) => update() && (loading = false);
- }}
- >
- <input type="hidden" name="username" value={username} />
- <label class="relative w-full flex flex-col">
- <span class="font-bold mb-3">Card number</span>
- <input
- class="rounded-md peer pl-12 pr-2 py-2 border-2 border-gray-200 placeholder-gray-300"
- type="text"
- name="number"
- placeholder="0000 0000 0000 0000"
- />
- <Card />
- </label>
+ <form
+ method="POST"
+ class="flex flex-wrap gap-5 w-full p-5 mt-20"
+ use:enhance={() => {
+ loading = true;
+ return ({ update }) => update() && (loading = false);
+ }}
+ >
+ <input type="hidden" name="username" value={username} />
+ <label class="relative w-full flex flex-col">
+ <span class="font-bold mb-3">Card number</span>
+ <input
+ class="rounded-md peer pl-12 pr-2 py-2 border-2 border-gray-200 placeholder-gray-300"
+ type="text"
+ name="number"
+ placeholder="0000 0000 0000 0000"
+ />
+ <Card />
+ </label>
- <label class="relative flex-1 flex flex-col">
- <span class="font-bold mb-3">Expire date</span>
- <input
- class="rounded-md peer pl-12 pr-2 py-2 border-2 border-gray-200 placeholder-gray-300"
- type="text"
- name="expiry"
- placeholder="MM/YY"
- />
- <Calendar />
- </label>
+ <label class="relative flex-1 flex flex-col">
+ <span class="font-bold mb-3">Expire date</span>
+ <input
+ class="rounded-md peer pl-12 pr-2 py-2 border-2 border-gray-200 placeholder-gray-300"
+ type="text"
+ name="expiry"
+ placeholder="MM/YY"
+ />
+ <Calendar />
+ </label>
- <label class="relative flex-1 flex flex-col">
- <span class="font-bold flex items-center gap-3 mb-3">
- CVC/CVV
- <span class="relative group">
- <span
- class="hidden group-hover:flex justify-center items-center px-2 py-1 text-xs absolute -right-2 transform translate-x-full -translate-y-1/2 w-max top-1/2 bg-black text-white"
- >
- 3-digit number on the back of your card</span
- >
- </span>
- </span>
- <input
- class="rounded-md peer pl-12 pr-2 py-2 border-2 border-gray-200 placeholder-gray-300"
- type="text"
- name="cvc"
- placeholder="&bull;&bull;&bull;"
- />
- <Lock />
- </label>
+ <label class="relative flex-1 flex flex-col">
+ <span class="font-bold flex items-center gap-3 mb-3">
+ CVC/CVV
+ <span class="relative group">
+ <span
+ class="hidden group-hover:flex justify-center items-center px-2 py-1 text-xs absolute -right-2 transform translate-x-full -translate-y-1/2 w-max top-1/2 bg-black text-white"
+ >
+ 3-digit number on the back of your card</span
+ >
+ </span>
+ </span>
+ <input
+ class="rounded-md peer pl-12 pr-2 py-2 border-2 border-gray-200 placeholder-gray-300"
+ type="text"
+ name="cvc"
+ placeholder="&bull;&bull;&bull;"
+ />
+ <Lock />
+ </label>
- <div class="w-full flex mt-8">
- <button
- class="bg-black text-white border rounded-full px-8 py-4 font-bold hover:opacity-80 mx-auto text-xl"
- type="submit"
- disabled={loading}
- >
- {#if loading}
- <Spinner />
- {:else}
- Submit
- {/if}
- </button>
- </div>
- </form>
+ <div class="w-full flex mt-8">
+ <button
+ class="bg-black text-white border rounded-full px-8 py-4 font-bold hover:opacity-80 mx-auto text-xl"
+ type="submit"
+ disabled={loading}
+ >
+ {#if loading}
+ <Spinner />
+ {:else}
+ Submit
+ {/if}
+ </button>
+ </div>
+ </form>
</div>
diff --git a/src/routes/(app)/launch/thanks/[asset]/+page.svelte b/src/routes/(app)/launch/thanks/[asset]/+page.svelte
index 43f10057..9b37002b 100644
--- a/src/routes/(app)/launch/thanks/[asset]/+page.svelte
+++ b/src/routes/(app)/launch/thanks/[asset]/+page.svelte
@@ -1,29 +1,31 @@
<script>
- import { page } from '$app/stores';
+ import { page } from "$app/stores";
- export let data;
+ export let data;
- let { user } = data;
+ let { user } = data;
- let { asset } = $page.params;
+ let { asset } = $page.params;
</script>
<div class="container mx-auto max-w-lg px-4 mt-20">
- <div class="font-normal text-gray-800 mx-auto mb-8 space-y-8">
- <h1 class="mb-4 text-4xl font-bold leading-none tracking-tight text-gray-800 text-center">
- Thanks!
- </h1>
+ <div class="font-normal text-gray-800 mx-auto mb-8 space-y-8">
+ <h1
+ class="mb-4 text-4xl font-bold leading-none tracking-tight text-gray-800 text-center"
+ >
+ Thanks!
+ </h1>
- <p>We look forward to seeing you!</p>
- </div>
+ <p>We look forward to seeing you!</p>
+ </div>
- <div class="w-full flex">
- <a href="/launch/ticket" class="mx-auto">
- <button
- class="bg-black text-white border rounded-full px-8 py-4 font-bold hover:opacity-80 text-2xl"
- >
- Done
- </button>
- </a>
- </div>
+ <div class="w-full flex">
+ <a href="/launch/ticket" class="mx-auto">
+ <button
+ class="bg-black text-white border rounded-full px-8 py-4 font-bold hover:opacity-80 text-2xl"
+ >
+ Done
+ </button>
+ </a>
+ </div>
</div>
diff --git a/src/routes/(app)/launch/ticket/+page.server.js b/src/routes/(app)/launch/ticket/+page.server.js
index 0362eb7d..7b51e679 100644
--- a/src/routes/(app)/launch/ticket/+page.server.js
+++ b/src/routes/(app)/launch/ticket/+page.server.js
@@ -1,9 +1,11 @@
-import { get } from '$lib/utils';
+import { get } from "$lib/utils";
export const load = async ({ cookies, parent }) => {
- let { user } = await parent();
- let tickets = await get('/tickets');
- let ticket = tickets.findIndex((t) => user.accounts.find((a) => a.asset === t));
- let asset = tickets[ticket];
- return { asset, ticket };
+ let { user } = await parent();
+ let tickets = await get("/tickets");
+ let ticket = tickets.findIndex((t) =>
+ user.accounts.find((a) => a.asset === t)
+ );
+ let asset = tickets[ticket];
+ return { asset, ticket };
};
diff --git a/src/routes/(app)/launch/ticket/+page.svelte b/src/routes/(app)/launch/ticket/+page.svelte
index 3879abcd..6b16e804 100644
--- a/src/routes/(app)/launch/ticket/+page.svelte
+++ b/src/routes/(app)/launch/ticket/+page.svelte
@@ -1,35 +1,37 @@
<script>
- export let data;
- let { asset, ticket } = data;
+ export let data;
+ let { asset, ticket } = data;
</script>
<div class="mx-auto h-screen flex items-center justify-center px-4">
- <div class="font-normal text-gray-800 mx-auto mb-8 space-y-8">
- <h1 class="mb-4 text-4xl font-bold leading-none tracking-tight text-gray-800 text-center">
- Your Ticket
- </h1>
+ <div class="font-normal text-gray-800 mx-auto mb-8 space-y-8">
+ <h1
+ class="mb-4 text-4xl font-bold leading-none tracking-tight text-gray-800 text-center"
+ >
+ Your Ticket
+ </h1>
- <p>
- We've minted your ticket as an <a
- href={`https://blockstream.info/liquid/asset/${asset}`}
- class="underline">NFT on the Liquid Blockchain</a
- > as a proof of purchase and commemorative token.
- </p>
+ <p>
+ We've minted your ticket as an <a
+ href={`https://blockstream.info/liquid/asset/${asset}`}
+ class="underline">NFT on the Liquid Blockchain</a
+ > as a proof of purchase and commemorative token.
+ </p>
- <img
- src={`/tickets/${(ticket + 1).toString().padStart(2, '0')}.png`}
- class="w-full max-w-[800px]"
- alt="Ticket"
- />
+ <img
+ src={`/tickets/${(ticket + 1).toString().padStart(2, "0")}.png`}
+ class="w-full max-w-[800px]"
+ alt="Ticket"
+ />
- <div class="w-full flex">
- <a href="/" class="mx-auto">
- <button
- class="bg-black text-white border rounded-full px-8 py-4 font-bold hover:opacity-80 text-2xl"
- >
- Done
- </button>
- </a>
- </div>
- </div>
+ <div class="w-full flex">
+ <a href="/" class="mx-auto">
+ <button
+ class="bg-black text-white border rounded-full px-8 py-4 font-bold hover:opacity-80 text-2xl"
+ >
+ Done
+ </button>
+ </a>
+ </div>
+ </div>
</div>