aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-12-07 15:10:24 -0800
committerAdam Soltys <[email protected]>2023-12-07 15:10:24 -0800
commit00e88944abb529d07e189f1181de8a4804f8ae9c (patch)
treeed161bcbf918b56b37d3c3417d6f4d5616f82ee8 /src/routes/(app)
parentae9106030759a88d0259a12b27a7cd0f2a422062 (diff)
downloadcoinos-ui-00e88944abb529d07e189f1181de8a4804f8ae9c.tar.gz
coinos-ui-00e88944abb529d07e189f1181de8a4804f8ae9c.zip
forgot password
Diffstat (limited to 'src/routes/(app)')
-rw-r--r--src/routes/(app)/+error.svelte3
-rw-r--r--src/routes/(app)/[username]/(profile)/+layout.svelte15
-rw-r--r--src/routes/(app)/[username]/(profile)/request/+page.svelte3
-rw-r--r--src/routes/(app)/[username]/card/[serial]/+page.svelte6
-rw-r--r--src/routes/(app)/[username]/funds/+page.svelte3
-rw-r--r--src/routes/(app)/[username]/invoice/[id]/+page.svelte24
-rw-r--r--src/routes/(app)/[username]/invoice/[id]/paid/+page.svelte12
-rw-r--r--src/routes/(app)/[username]/receive/[...param]/+page.svelte3
-rw-r--r--src/routes/(app)/[username]/settings/[...tab]/+page.svelte4
-rw-r--r--src/routes/(app)/[username]/settings/[...tab]/_pos.svelte6
-rw-r--r--src/routes/(app)/[username]/settings/[...tab]/_security.svelte6
-rw-r--r--src/routes/(app)/[username]/settings/[...tab]/_shopify.svelte4
-rw-r--r--src/routes/(app)/buy/+page.svelte11
-rw-r--r--src/routes/(app)/forgot/+page.server.js16
-rw-r--r--src/routes/(app)/forgot/+page.svelte58
-rw-r--r--src/routes/(app)/fund/[id]/+page.svelte12
-rw-r--r--src/routes/(app)/fund/[id]/withdraw/+page.svelte3
-rw-r--r--src/routes/(app)/launch/+page.svelte7
-rw-r--r--src/routes/(app)/launch/purchase/+page.svelte17
-rw-r--r--src/routes/(app)/launch/purchase/card/+page.svelte8
-rw-r--r--src/routes/(app)/launch/thanks/[asset]/+page.svelte7
-rw-r--r--src/routes/(app)/launch/ticket/+page.svelte7
-rw-r--r--src/routes/(app)/login/+page.svelte175
-rw-r--r--src/routes/(app)/payment/[id]/+page.svelte8
-rw-r--r--src/routes/(app)/register/+page.server.js11
-rw-r--r--src/routes/(app)/register/+page.svelte24
-rw-r--r--src/routes/(app)/scan/+page.svelte5
-rw-r--r--src/routes/(app)/send/[...text]/+page.svelte12
-rw-r--r--src/routes/(app)/send/bitcoin/[address]/[...amount]/+page.server.js12
-rw-r--r--src/routes/(app)/send/bitcoin/[address]/[...amount]/+page.svelte3
-rw-r--r--src/routes/(app)/send/fund/[name]/[...amount]/+page.svelte3
-rw-r--r--src/routes/(app)/send/invoice/[id]/+page.svelte6
-rw-r--r--src/routes/(app)/send/lightning/[payreq]/+page.svelte10
-rw-r--r--src/routes/(app)/send/user/[username]/[...amount]/+page.svelte8
-rw-r--r--src/routes/(app)/support/+page.svelte9
35 files changed, 358 insertions, 163 deletions
diff --git a/src/routes/(app)/+error.svelte b/src/routes/(app)/+error.svelte
index 6ce7979c..b5a5e139 100644
--- a/src/routes/(app)/+error.svelte
+++ b/src/routes/(app)/+error.svelte
@@ -27,8 +27,7 @@
<div class="flex justify-center py-24">
<a href={link}>
<button
- class="bg-black text-white border rounded-full px-8 py-4 font-bold hover:opacity-80 text-xl"
- >
+ class="bg-black text-white border rounded-full px-8 py-4 font-bold hover:opacity-80 text-xl">
Back
</button>
</a>
diff --git a/src/routes/(app)/[username]/(profile)/+layout.svelte b/src/routes/(app)/[username]/(profile)/+layout.svelte
index 71c282c4..e33c4b23 100644
--- a/src/routes/(app)/[username]/(profile)/+layout.svelte
+++ b/src/routes/(app)/[username]/(profile)/+layout.svelte
@@ -157,8 +157,7 @@
<div class="w-full flex">
<button
class="mx-auto rounded-full border py-3 px-6 font-bold hover:opacity-80 flex w-60 bg-black text-white"
- on:click={unfollow}
- >
+ on:click={unfollow}>
<div class="mx-auto flex">
<Icon icon={"profile"} style="my-auto h-6 mr-2 invert" />
<div class="my-auto">{$t("user.following")}</div>
@@ -169,8 +168,7 @@
<div class="w-full flex">
<button
class="mx-auto rounded-full border py-3 px-6 font-bold hover:opacity-80 flex w-60"
- on:click={follow}
- >
+ on:click={follow}>
<div class="mx-auto flex">
<Icon icon={"profile"} style="my-auto h-6 mr-2" />
<div class="my-auto">{$t("user.follow")}</div>
@@ -184,8 +182,7 @@
<div class="w-full flex">
<a href={`/${subject.username}/messages`} class="mx-auto">
<button
- class="rounded-full border py-3 px-6 font-bold hover:opacity-80 flex w-60"
- >
+ class="rounded-full border py-3 px-6 font-bold hover:opacity-80 flex w-60">
<div class="mx-auto flex">
<Icon icon="message" style="mr-2 my-auto" />
<div class="mt-1 my-auto">{$t("user.message")}</div>
@@ -201,11 +198,9 @@
href={user
? `/send/${subject.username}`
: `/${subject.username}/receive`}
- class="mx-auto"
- >
+ class="mx-auto">
<button
- class="rounded-full border py-3 px-6 font-bold hover:opacity-80 flex w-60"
- >
+ class="rounded-full border py-3 px-6 font-bold hover:opacity-80 flex w-60">
<div class="mx-auto flex">
<Icon icon="send" style="mr-2" />
<div class="mt-1">{$t("user.pay")}</div>
diff --git a/src/routes/(app)/[username]/(profile)/request/+page.svelte b/src/routes/(app)/[username]/(profile)/request/+page.svelte
index a07ee914..373a1302 100644
--- a/src/routes/(app)/[username]/(profile)/request/+page.svelte
+++ b/src/routes/(app)/[username]/(profile)/request/+page.svelte
@@ -26,8 +26,7 @@
<div class="w-full flex">
<button
type="submit"
- class="bg-black text-white border rounded-full px-6 py-2 font-bold mx-auto"
- >
+ class="bg-black text-white border rounded-full px-6 py-2 font-bold mx-auto">
{$t("payments.submit")}
</button>
</div>
diff --git a/src/routes/(app)/[username]/card/[serial]/+page.svelte b/src/routes/(app)/[username]/card/[serial]/+page.svelte
index 1d11ebee..1792b443 100644
--- a/src/routes/(app)/[username]/card/[serial]/+page.svelte
+++ b/src/routes/(app)/[username]/card/[serial]/+page.svelte
@@ -13,15 +13,13 @@
<div class="flex justify-center">
<a href={`/send/pot/${serial}`}>
<button
- class="rounded-full border py-3 px-6 font-bold hover:opacity-80 flex w-60 bg-black text-white justify-center gap-2"
- >
+ class="rounded-full border py-3 px-6 font-bold hover:opacity-80 flex w-60 bg-black text-white justify-center gap-2">
<svg
xmlns="http://www.w3.org/2000/svg"
class="invert text-black peer-placeholder-shown:text-gray-300 h-6 w-6 my-auto"
fill="none"
viewBox="0 0 24 24"
- stroke="currentColor"
- >
+ stroke="currentColor">
<path
stroke-linecap="round"
stroke-linejoin="round"
diff --git a/src/routes/(app)/[username]/funds/+page.svelte b/src/routes/(app)/[username]/funds/+page.svelte
index 25686e86..edbe22a5 100644
--- a/src/routes/(app)/[username]/funds/+page.svelte
+++ b/src/routes/(app)/[username]/funds/+page.svelte
@@ -37,8 +37,7 @@
</div>
<button
- class="ml-auto rounded-full border py-2 px-4 w-36 hover:opacity-80 flex mx-auto"
- >
+ class="ml-auto rounded-full border py-2 px-4 w-36 hover:opacity-80 flex mx-auto">
<Icon icon="plus" style="opacity-50 mr-2 my-auto" />
<div class="my-auto">{$t("payments.create")}</div>
</button>
diff --git a/src/routes/(app)/[username]/invoice/[id]/+page.svelte b/src/routes/(app)/[username]/invoice/[id]/+page.svelte
index 0ff1c21c..13c75fca 100644
--- a/src/routes/(app)/[username]/invoice/[id]/+page.svelte
+++ b/src/routes/(app)/[username]/invoice/[id]/+page.svelte
@@ -130,17 +130,13 @@
class="rounded-full border py-2 px-4 font-bold hover:opacity-80 w-full"
class:bg-black={type === types.lightning}
class:text-white={type === types.lightning}
- on:click={toggleType}
- >
- ⚡️ Lightning
- </button>
+ on:click={toggleType}> ⚡️ Lightning </button>
<button
class="rounded-full border py-2 px-4 font-bold hover:opacity-80 w-full flex justify-center"
class:bg-black={type === types.bitcoin}
class:text-white={type === types.bitcoin}
- on:click={toggleType}
- >
+ on:click={toggleType}>
<img
src="/images/bitcoin.svg"
class="my-auto w-8 border-4 border-transparent"
@@ -155,8 +151,7 @@
<a
href={invoice.type === "bitcoin"
? invoice.text
- : "lightning:" + invoice.text}
- >
+ : "lightning:" + invoice.text}>
<div class="relative flex">
<div class="flex mx-auto w-[360px] h-[360px]">
<img
@@ -208,8 +203,7 @@
<div class="w-full flex justify-center gap-2 flex-wrap">
<a href={link} class="w-full md:w-auto">
<button
- class="w-full md:w-auto flex justify-center rounded-full border py-3 px-5 hover:opacity-80"
- >
+ class="w-full md:w-auto flex justify-center rounded-full border py-3 px-5 hover:opacity-80">
<Icon icon="mobile" style="mr-1 w-6" />
<div class="text-secondary">{$t("payments.openLink")}</div>
</button>
@@ -217,16 +211,18 @@
<button
class="flex rounded-full justify-center border py-3 px-5 hover:opacity-80 w-full md:w-auto"
- on:click={() => copy(txt)}
- >
+ on:click={() => copy(txt)}>
+
+
<Icon icon="copy" style="mr-1" />
<div class="text-secondary">{$t("payments.copyText")}</div></button
>
<button
class="w-full md:w-auto flex justify-center rounded-full border py-3 px-5 hover:opacity-80"
- on:click={() => (showQr = !showQr)}
- >
+ on:click={() => (showQr = !showQr)}>
+
+
<Icon icon="qr" style="mr-1 invert" />
<div class="text-secondary">
{showQr ? $t("payments.hide") : $t("payments.show")}
diff --git a/src/routes/(app)/[username]/invoice/[id]/paid/+page.svelte b/src/routes/(app)/[username]/invoice/[id]/paid/+page.svelte
index 9740dc92..bc974b9a 100644
--- a/src/routes/(app)/[username]/invoice/[id]/paid/+page.svelte
+++ b/src/routes/(app)/[username]/invoice/[id]/paid/+page.svelte
@@ -9,8 +9,16 @@
export let data;
let amount, currency, rate, received, pending, tip, user, id;
$: data &&
- ({ amount, currency, rate, received, pending, tip, user, id } =
- data.invoice);
+ ({
+ amount,
+ currency,
+ rate,
+ received,
+ pending,
+ tip,
+ user,
+ id,
+ } = data.invoice);
toast.pop(0);
</script>
diff --git a/src/routes/(app)/[username]/receive/[...param]/+page.svelte b/src/routes/(app)/[username]/receive/[...param]/+page.svelte
index 49e279b9..840f0277 100644
--- a/src/routes/(app)/[username]/receive/[...param]/+page.svelte
+++ b/src/routes/(app)/[username]/receive/[...param]/+page.svelte
@@ -48,8 +48,7 @@
bind:this={submit}
type="submit"
class="bg-black text-white rounded-xl w-full h-[48px] flex justify-center items-center font-semibold
- opacity-100 hover:opacity-80"
- >
+ opacity-100 hover:opacity-80">
{$t("payments.next")}
</button>
</div>
diff --git a/src/routes/(app)/[username]/settings/[...tab]/+page.svelte b/src/routes/(app)/[username]/settings/[...tab]/+page.svelte
index e77213c2..b4283e72 100644
--- a/src/routes/(app)/[username]/settings/[...tab]/+page.svelte
+++ b/src/routes/(app)/[username]/settings/[...tab]/+page.svelte
@@ -220,8 +220,7 @@
bind:this={submit}
type="submit"
class="border-2 border-black rounded-xl font-semibold mx-auto py-3 w-40 hover:opacity-80"
- class:bg-black={loading}
- >
+ class:bg-black={loading}>
{#if loading}
<Spinner />
{:else}
@@ -236,4 +235,3 @@
view-transition-name: settings;
}
</style>
-
diff --git a/src/routes/(app)/[username]/settings/[...tab]/_pos.svelte b/src/routes/(app)/[username]/settings/[...tab]/_pos.svelte
index 8193bc9c..e211b013 100644
--- a/src/routes/(app)/[username]/settings/[...tab]/_pos.svelte
+++ b/src/routes/(app)/[username]/settings/[...tab]/_pos.svelte
@@ -25,8 +25,7 @@
<select
name="currency"
class="select-styles block py-3 w-full"
- value={user.currency}
- >
+ value={user.currency}>
{#each fiats as fiat}
<option value={fiat}>{fiat}</option>
{/each}
@@ -74,8 +73,7 @@
<a href="./shopify">
<button
type="button"
- class="flex rounded-full border py-2 px-4 font-bold hover:opacity-80 w-full gap-2 my-5 justify-center"
- >
+ class="flex rounded-full border py-2 px-4 font-bold hover:opacity-80 w-full gap-2 my-5 justify-center">
<img src="/icons/shopify.svg" class="w-8" />
<div class="my-auto">Shopify Integration</div>
</button>
diff --git a/src/routes/(app)/[username]/settings/[...tab]/_security.svelte b/src/routes/(app)/[username]/settings/[...tab]/_security.svelte
index 38bf726c..3aa7012e 100644
--- a/src/routes/(app)/[username]/settings/[...tab]/_security.svelte
+++ b/src/routes/(app)/[username]/settings/[...tab]/_security.svelte
@@ -167,8 +167,7 @@
type="button"
on:click={togglePassword}
on:keydown={togglePassword}
- class="absolute right-5 top-11"
- >
+ class="absolute right-5 top-11">
<Icon icon={revealPassword ? "eye" : "eye-off"} />
</button>
</div>
@@ -212,8 +211,7 @@
<select
name="locktime"
class="select-styles block py-3 w-full"
- value={parseInt(user.locktime)}
- >
+ value={parseInt(user.locktime)}>
<option value={5 * 60}>5 {$t("user.settings.minutes")}</option>
<option value={10 * 60}>10 {$t("user.settings.minutes")}</option>
<option value={30 * 60}>30 {$t("user.settings.minutes")}</option>
diff --git a/src/routes/(app)/[username]/settings/[...tab]/_shopify.svelte b/src/routes/(app)/[username]/settings/[...tab]/_shopify.svelte
index 0266fa9c..870803fb 100644
--- a/src/routes/(app)/[username]/settings/[...tab]/_shopify.svelte
+++ b/src/routes/(app)/[username]/settings/[...tab]/_shopify.svelte
@@ -28,9 +28,7 @@
<div class="flex mb-2">
<div
class="text-gray-600 p-4 my-auto bg-gray-100 border rounded-l-2xl border-r-0 pr-1"
- >
- admin.shopify.com/store/
- </div>
+ >admin.shopify.com/store/</div>
<input
type="text"
name="shopifyStore"
diff --git a/src/routes/(app)/buy/+page.svelte b/src/routes/(app)/buy/+page.svelte
index 2b81b7a8..affb77ee 100644
--- a/src/routes/(app)/buy/+page.svelte
+++ b/src/routes/(app)/buy/+page.svelte
@@ -60,7 +60,8 @@
/>
<span
class="absolute bottom-[9px] left-0 translate-x-1/2 w-6 text-black peer-placeholder-shown:text-gray-300
- ">$</span
+ "
+ >$</span
>
</label>
@@ -93,8 +94,9 @@
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"
- >
+ 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>
@@ -113,8 +115,7 @@
<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}
- >
+ disabled={loading}>
{#if loading}
<Spinner />
{:else}
diff --git a/src/routes/(app)/forgot/+page.server.js b/src/routes/(app)/forgot/+page.server.js
new file mode 100644
index 00000000..db2005e7
--- /dev/null
+++ b/src/routes/(app)/forgot/+page.server.js
@@ -0,0 +1,16 @@
+import { fail, redirect } from "@sveltejs/kit";
+import { fd, post, login } from "$lib/utils";
+
+export const actions = {
+ default: async ({ request }) => {
+ let { email } = await fd(request);
+
+ try {
+ await post("/forgot", { email });
+ return { success: true };
+ } catch (e) {
+ console.log(e.message);
+ return fail(400, { error: e.message });
+ }
+ },
+};
diff --git a/src/routes/(app)/forgot/+page.svelte b/src/routes/(app)/forgot/+page.svelte
new file mode 100644
index 00000000..91c4290a
--- /dev/null
+++ b/src/routes/(app)/forgot/+page.svelte
@@ -0,0 +1,58 @@
+<script>
+ import { t } from "$lib/translations";
+ import Icon from "$comp/Icon.svelte";
+ import Spinner from "$comp/Spinner.svelte";
+ import { fly } from "svelte/transition";
+
+ export let form;
+ let email;
+ let loading;
+</script>
+
+<div class="pt-10">
+ <div class="w-[243px] mx-auto mb-10">
+ <a href="/">
+ <Icon icon="logo" />
+ </a>
+ </div>
+
+ <div class="flex justify-center items-center">
+ <div
+ class="shadow-xl rounded-3xl p-10 pb-12 space-y-5 w-full mx-5 md:mx-0 md:w-[400px]"
+ >
+ <h1 class="text-2xl font-bold text-center">{$t("login.reset")}</h1>
+
+ {#if form?.error}
+ <div class="text-red-600 text-center" in:fly>
+ {form.error}
+ </div>
+ {/if}
+
+ <form class="space-y-5" method="POST">
+ <div>
+ <label for="email" class="font-semibold">{$t("login.email")}</label>
+ <input
+ name="email"
+ type="text"
+ required
+ class="bg-primary"
+ bind:value={email}
+ use:focus
+ autocapitalize="none"
+ />
+ </div>
+
+ <button
+ type="submit"
+ class="bg-black text-white w-full rounded-2xl p-4 font-semibold hover:opacity-80"
+ disabled={loading}>
+ {#if loading}
+ <Spinner />
+ {:else}
+ {$t("login.submit")}
+ {/if}
+ </button>
+ </form>
+ </div>
+ </div>
+</div>
diff --git a/src/routes/(app)/fund/[id]/+page.svelte b/src/routes/(app)/fund/[id]/+page.svelte
index b81e2917..ebb1a517 100644
--- a/src/routes/(app)/fund/[id]/+page.svelte
+++ b/src/routes/(app)/fund/[id]/+page.svelte
@@ -62,8 +62,7 @@
<div class="grow">
<a href={`/send/fund/${id}`}>
<button
- class="rounded-full border py-3 px-2 font-bold hover:opacity-80 flex gap-1 w-full justify-center"
- >
+ class="rounded-full border py-3 px-2 font-bold hover:opacity-80 flex gap-1 w-full justify-center">
<Icon icon="plus" />
{$t("payments.addFunds")}
</button>
@@ -72,8 +71,7 @@
<div class="grow">
<a href={`/fund/${id}/withdraw`}>
<button
- class="rounded-full border py-3 px-2 font-bold hover:opacity-80 flex gap-1 w-full justify-center"
- >
+ class="rounded-full border py-3 px-2 font-bold hover:opacity-80 flex gap-1 w-full justify-center">
<Icon icon="minus" style="rotate-180" />
{$t("payments.takeFunds")}
</button>
@@ -83,15 +81,13 @@
<div class="flex gap-2" data-sveltekit-prefetch="off">
<button
class="rounded-full border py-3 px-2 font-bold hover:opacity-80 flex gap-1 w-full justify-center"
- on:click={toggle}
- >
+ on:click={toggle}>
<Icon icon="qr" style="invert" />
{show ? $t("payments.hide") : $t("payments.show")} QR
</button>
<button
class="rounded-full border py-3 px-2 font-bold hover:opacity-80 flex gap-1 w-full justify-center"
- on:click={() => copy($page.url.host + $page.url.pathname)}
- >
+ on:click={() => copy($page.url.host + $page.url.pathname)}>
<Icon icon="copy" style="w-6" />
{$t("payments.copyLink")}
</button>
diff --git a/src/routes/(app)/fund/[id]/withdraw/+page.svelte b/src/routes/(app)/fund/[id]/withdraw/+page.svelte
index 7af07e38..e7c1d852 100644
--- a/src/routes/(app)/fund/[id]/withdraw/+page.svelte
+++ b/src/routes/(app)/fund/[id]/withdraw/+page.svelte
@@ -47,8 +47,7 @@
<div class="flex w-full">
<button
type="submit"
- class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24"
- >
+ class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24">
{#if loading}
<Spinner />
{:else}
diff --git a/src/routes/(app)/launch/+page.svelte b/src/routes/(app)/launch/+page.svelte
index ef02ae0f..cb43e63e 100644
--- a/src/routes/(app)/launch/+page.svelte
+++ b/src/routes/(app)/launch/+page.svelte
@@ -58,9 +58,7 @@
<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>
+ >Launch Party!</h1>
<p class="leading-normal mb-2">
Come join us at our launch party celebrating our new design and 10
@@ -106,8 +104,7 @@
<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"
- >
+ class="bg-white text-black border rounded-full px-8 py-4 font-bold hover:opacity-80 text-2xl">
{text}
</button>
</a>
diff --git a/src/routes/(app)/launch/purchase/+page.svelte b/src/routes/(app)/launch/purchase/+page.svelte
index 49a51973..3af3b186 100644
--- a/src/routes/(app)/launch/purchase/+page.svelte
+++ b/src/routes/(app)/launch/purchase/+page.svelte
@@ -21,9 +21,7 @@
<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>
+ >Purchase Ticket</h1>
<img
src={`/tickets/${(ticket + 1).toString().padStart(2, "0")}.png`}
@@ -37,8 +35,7 @@
<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"
- >
+ 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>
@@ -46,25 +43,21 @@
{:else}
<h1
class="mb-4 text-xl font-bold leading-none tracking-tight text-gray-800 text-center"
- >
- Payment Options
- </h1>
+ >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"
- >
+ 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"
- >
+ class="border rounded-full px-8 py-4 font-bold hover:opacity-80 mx-auto text-2xl">
Credit Card
</button>
</a>
diff --git a/src/routes/(app)/launch/purchase/card/+page.svelte b/src/routes/(app)/launch/purchase/card/+page.svelte
index 6d33c87f..d7ef830d 100644
--- a/src/routes/(app)/launch/purchase/card/+page.svelte
+++ b/src/routes/(app)/launch/purchase/card/+page.svelte
@@ -48,8 +48,9 @@
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"
- >
+ 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>
@@ -67,8 +68,7 @@
<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}
- >
+ disabled={loading}>
{#if loading}
<Spinner />
{:else}
diff --git a/src/routes/(app)/launch/thanks/[asset]/+page.svelte b/src/routes/(app)/launch/thanks/[asset]/+page.svelte
index 9b37002b..3d8fb844 100644
--- a/src/routes/(app)/launch/thanks/[asset]/+page.svelte
+++ b/src/routes/(app)/launch/thanks/[asset]/+page.svelte
@@ -12,9 +12,7 @@
<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>
+ >Thanks!</h1>
<p>We look forward to seeing you!</p>
</div>
@@ -22,8 +20,7 @@
<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"
- >
+ class="bg-black text-white border rounded-full px-8 py-4 font-bold hover:opacity-80 text-2xl">
Done
</button>
</a>
diff --git a/src/routes/(app)/launch/ticket/+page.svelte b/src/routes/(app)/launch/ticket/+page.svelte
index 6b16e804..a4888727 100644
--- a/src/routes/(app)/launch/ticket/+page.svelte
+++ b/src/routes/(app)/launch/ticket/+page.svelte
@@ -7,9 +7,7 @@
<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>
+ >Your Ticket</h1>
<p>
We've minted your ticket as an <a
@@ -27,8 +25,7 @@
<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"
- >
+ class="bg-black text-white border rounded-full px-8 py-4 font-bold hover:opacity-80 text-2xl">
Done
</button>
</a>
diff --git a/src/routes/(app)/login/+page.svelte b/src/routes/(app)/login/+page.svelte
index 647ef03c..61eea586 100644
--- a/src/routes/(app)/login/+page.svelte
+++ b/src/routes/(app)/login/+page.svelte
@@ -1,7 +1,18 @@
<script>
- import RegisterOrLogin from "$comp/RegisterOrLogin.svelte";
import { onMount } from "svelte";
- import { pin } from "$lib/store";
+ import { applyAction, deserialize } from "$app/forms";
+ import { tick } from "svelte";
+ import { fly } from "svelte/transition";
+ import { enhance } from "$app/forms";
+ import Pin from "$comp/Pin.svelte";
+ import Icon from "$comp/Icon.svelte";
+ import Spinner from "$comp/Spinner.svelte";
+ import { focus, fail } from "$lib/utils";
+ import { password, pin, loginRedirect } from "$lib/store";
+ import { t } from "$lib/translations";
+ import { page } from "$app/stores";
+ import { generate } from "$lib/nostr";
+ import { invalidateAll } from "$app/navigation";
onMount(() => {
$pin = undefined;
@@ -10,6 +21,164 @@
});
export let form;
+
+ let token, formElement;
+ let code = [];
+ let redirect;
+
+ $password = undefined;
+
+ $: need2fa = form?.message === "2fa";
+ let cancel = () => (need2fa = false);
+ $: if (form?.message === "2fa" && form.token === token) token = "";
+
+ let username, email, btn;
+
+ $: update(form);
+ let update = (form) => form && ({ username, password: $password } = form);
+
+ $: token && token?.length === 6 && tick().then(() => btn.click());
+
+ let revealPassword = false;
+
+ let loading;
+ async function handleSubmit(e) {
+ loading = true;
+
+ let data = new FormData(this);
+ let user = Object.fromEntries(data);
+ await generate(user);
+
+ for (let k in user) {
+ data.set(k, user[k]);
+ }
+
+ const response = await fetch("/login", {
+ method: "POST",
+ body: data,
+ });
+
+ const result = deserialize(await response.text());
+
+ if (result.type === "success") {
+ await invalidateAll();
+ }
+
+ applyAction(result);
+ loading = false;
+ }
</script>
-<RegisterOrLogin pageID="signIn" bind:form />
+{#if need2fa}
+ <Pin bind:value={token} title="Enter 2FA Code" {cancel} notify={false} />
+{/if}
+
+<div class="pt-10">
+ <div class="w-[243px] mx-auto mb-10">
+ <a href="/">
+ <Icon icon="logo" />
+ </a>
+ </div>
+
+ <div class="flex justify-center items-center">
+ <div
+ class="shadow-xl rounded-3xl p-10 pb-12 space-y-5 w-full mx-5 md:mx-0 md:w-[400px]"
+ >
+ <h1 class="text-2xl font-bold text-center">{$t("login.signIn")}</h1>
+
+ {#if form?.error}
+ <div class="text-red-600 text-center" in:fly>
+ {form.error}
+ </div>
+ {/if}
+
+ <form
+ class="space-y-5"
+ on:submit|preventDefault={handleSubmit}
+ method="POST"
+ >
+ <input
+ type="hidden"
+ name="loginRedirect"
+ value={$loginRedirect || $page.url.searchParams.get("redirect")}
+ />
+ <input type="hidden" name="token" value={token} />
+
+ <div>
+ <label for="username" class="font-semibold"
+ >{$t("login.username")}</label
+ >
+ <input
+ name="username"
+ type="text"
+ required
+ class="bg-primary"
+ bind:value={username}
+ use:focus
+ autocapitalize="none"
+ />
+ </div>
+
+ <div class="relative">
+ <label for="password" class="block font-semibold"
+ >{$t("login.password")}</label
+ >
+ {#if revealPassword}
+ <input
+ name="password"
+ type="text"
+ required
+ class="bg-primary"
+ bind:value={$password}
+ autocapitalize="none"
+ />
+ {:else}
+ <input
+ name="password"
+ type="password"
+ required
+ class="bg-primary"
+ bind:value={$password}
+ autocapitalize="none"
+ />
+ {/if}
+ <button
+ type="button"
+ on:click={() => (revealPassword = !revealPassword)}
+ class="absolute right-5 top-10">
+ <Icon icon={revealPassword ? "eye" : "eye-off"} />
+ </button>
+ </div>
+
+ <div class="flex justify-end items-center">
+ <a
+ href="/forgot"
+ class="underline underline-offset-4 text-black text-sm"
+ >{$t("login.forgotUserOrPassword")}</a
+ >
+ </div>
+
+ <button
+ type="submit"
+ class="bg-black text-white w-full rounded-2xl p-4 font-semibold hover:opacity-80"
+ disabled={loading}
+ bind:this={btn}>
+ {#if loading}
+ <Spinner />
+ {:else}
+ {$t("login.signIn")}
+ {/if}
+ </button>
+ </form>
+
+ <p class="text-secondary text-center font-medium">
+ {$t("login.haveAccount")}
+ <a
+ href={"/register"}
+ class="block md:inline text-black underline underline-offset-4 hover:opacity-80">
+ {$t("login.register")}
+ </a>
+ </p>
+ </div>
+ </div>
+</div>
diff --git a/src/routes/(app)/payment/[id]/+page.svelte b/src/routes/(app)/payment/[id]/+page.svelte
index fd5bbae0..a1c7bbed 100644
--- a/src/routes/(app)/payment/[id]/+page.svelte
+++ b/src/routes/(app)/payment/[id]/+page.svelte
@@ -140,6 +140,8 @@
class="flex font-bold hover:opacity-80 mb-auto my-auto"
on:click={() => copy(id)}
><Icon icon="copy" style="ml-2 w-20 my-auto" />
+
+
</button>
</div>
</div>
@@ -149,8 +151,7 @@
<div>
<button
class="rounded-full border py-3 px-6 hover:opacity-80 flex w-full md:w-60"
- on:click={print}
- >
+ on:click={print}>
<div class="mx-auto flex">
<Icon icon="printer" style="my-auto h-6 mr-2" />
<div class="my-auto mt-1 text-base">{$t("payments.print")}</div>
@@ -161,8 +162,7 @@
<div>
<a href={`/payment/${id}/plain`}>
<button
- class="rounded-full border py-3 px-6 hover:opacity-80 flex w-full md:w-60"
- >
+ class="rounded-full border py-3 px-6 hover:opacity-80 flex w-full md:w-60">
<div class="mx-auto flex">
<Icon icon="printer" style="my-auto h-6 mr-2" />
<div class="my-auto mt-1 text-base">{$t("payments.print")}</div>
diff --git a/src/routes/(app)/register/+page.server.js b/src/routes/(app)/register/+page.server.js
index e986c73d..babeeb03 100644
--- a/src/routes/(app)/register/+page.server.js
+++ b/src/routes/(app)/register/+page.server.js
@@ -15,8 +15,15 @@ export const actions = {
let ip = request.headers.get("cf-connecting-ip");
let form = await fd(request);
- let { profile, username, password, cipher, salt, pubkey, loginRedirect } =
- form;
+ let {
+ profile,
+ username,
+ password,
+ cipher,
+ salt,
+ pubkey,
+ loginRedirect,
+ } = form;
let user = { profile, username, password, cipher, salt, pubkey };
let error;
diff --git a/src/routes/(app)/register/+page.svelte b/src/routes/(app)/register/+page.svelte
index 5783059a..ef057fcf 100644
--- a/src/routes/(app)/register/+page.svelte
+++ b/src/routes/(app)/register/+page.svelte
@@ -175,14 +175,12 @@
<div class="relative">
<button
class="absolute w-8 h-12 left-12 bg-white rounded top-12"
- on:click={decr}
- >
+ on:click={decr}>
<Icon icon="chevron-left" style="w-8 " />
</button>
<div class="relative w-32 mx-auto" on:click={selectAvatar}>
<button
- class="w-32 h-32 rounded-full border-4 border-white overflow-hidden flex mx-auto relative"
- >
+ class="w-32 h-32 rounded-full border-4 border-white overflow-hidden flex mx-auto relative">
<img
{src}
class="w-full h-full object-cover object-center overflow-hidden"
@@ -190,15 +188,13 @@
/>
</button>
<button
- class="absolute bg-white rounded-full p-2 mx-auto right-0 bottom-0 z-10 bg-opacity-80"
- >
+ class="absolute bg-white rounded-full p-2 mx-auto right-0 bottom-0 z-10 bg-opacity-80">
<Icon icon="upload" style="w-8" />
</button>
</div>
<button
class="absolute w-8 h-12 right-12 bg-white rounded top-12"
- on:click={incr}
- >
+ on:click={incr}>
<Icon icon="chevron-left" style="w-8 rotate-180" />
</button>
</div>
@@ -240,8 +236,7 @@
type="button"
on:click={refresh}
class="absolute right-0 top-4"
- tabindex="5"
- >
+ tabindex="5">
<Icon icon="random" style="w-10 m-4" />
</button>
</div>
@@ -276,8 +271,7 @@
type="button"
tabindex="4"
on:click={() => (revealPassword = !revealPassword)}
- class="absolute right-0 top-4"
- >
+ class="absolute right-0 top-4">
<Icon icon={revealPassword ? "eye" : "eye-off"} style="m-6" />
</button>
</div>
@@ -291,8 +285,7 @@
type="submit"
class="bg-black text-white w-full rounded-2xl p-4 font-semibold hover:opacity-80"
disabled={loading}
- bind:this={btn}
- >
+ bind:this={btn}>
{#if loading}
<Spinner />
{:else}
@@ -305,8 +298,7 @@
{$t("login.haveAccount")}
<a
href={"/login"}
- class="block md:inline text-black underline underline-offset-4 hover:opacity-80"
- >
+ class="block md:inline text-black underline underline-offset-4 hover:opacity-80">
{$t("login.signIn")}
</a>
</p>
diff --git a/src/routes/(app)/scan/+page.svelte b/src/routes/(app)/scan/+page.svelte
index e23b9bb8..c02fc1c2 100644
--- a/src/routes/(app)/scan/+page.svelte
+++ b/src/routes/(app)/scan/+page.svelte
@@ -37,10 +37,7 @@
<div class="flex w-full mb-4">
<button
class="mx-auto border rounded-full px-6 py-2 font-bold hover:opacity-80"
- on:click={back}
- >
- Cancel
- </button>
+ on:click={back}> Cancel </button>
</div>
<style>
diff --git a/src/routes/(app)/send/[...text]/+page.svelte b/src/routes/(app)/send/[...text]/+page.svelte
index 8548964c..b76e067e 100644
--- a/src/routes/(app)/send/[...text]/+page.svelte
+++ b/src/routes/(app)/send/[...text]/+page.svelte
@@ -63,8 +63,7 @@
<a href={`/qr/${encodeURIComponent(text)}`}>
<button
type="button"
- class="flex border rounded-full px-6 py-2 font-bold hover:opacity-80 mr-1"
- >
+ class="flex border rounded-full px-6 py-2 font-bold hover:opacity-80 mr-1">
<Icon icon="qr" style="mr-2 w-6 my-auto invert" />
<div class="my-auto">{$t("user.send.makeQR")}</div>
</button>
@@ -74,8 +73,7 @@
<a href="/scan">
<button
type="button"
- class="flex border rounded-full px-6 py-2 font-bold hover:opacity-80 mr-1"
- >
+ class="flex border rounded-full px-6 py-2 font-bold hover:opacity-80 mr-1">
<Icon icon="camera" style="mr-2 w-6 my-auto" />
<div class="my-auto">{$t("user.send.scan")}</div>
</button>
@@ -84,8 +82,7 @@
<button
type="button"
class="flex border rounded-full px-6 py-2 font-bold hover:opacity-80 mr-1"
- on:click={paste}
- >
+ on:click={paste}>
<Icon icon="paste" style="mr-2 w-6 my-auto" />
<div class="my-auto">{$t("user.send.paste")}</div>
</button>
@@ -95,8 +92,7 @@
type="submit"
class="{!text
? 'opacity-50'
- : 'opacity-100 hover:opacity-80'} bg-black text-white border rounded-full px-6 py-2 font-bold"
- >
+ : 'opacity-100 hover:opacity-80'} bg-black text-white border rounded-full px-6 py-2 font-bold">
{$t("user.send.next")}
</button>
</div>
diff --git a/src/routes/(app)/send/bitcoin/[address]/[...amount]/+page.server.js b/src/routes/(app)/send/bitcoin/[address]/[...amount]/+page.server.js
index 5cb86aec..aaccf762 100644
--- a/src/routes/(app)/send/bitcoin/[address]/[...amount]/+page.server.js
+++ b/src/routes/(app)/send/bitcoin/[address]/[...amount]/+page.server.js
@@ -5,8 +5,16 @@ let seen = {};
export const actions = {
default: async ({ cookies, request }) => {
try {
- let { address, amount, confirmed, feeRate, subtract, pin, stale, ts } =
- await await fd(request);
+ let {
+ address,
+ amount,
+ confirmed,
+ feeRate,
+ subtract,
+ pin,
+ stale,
+ ts,
+ } = await await fd(request);
if (seen[ts]) return fail(400, { message: "Duplicate form submission" });
let estimate = await post(
diff --git a/src/routes/(app)/send/bitcoin/[address]/[...amount]/+page.svelte b/src/routes/(app)/send/bitcoin/[address]/[...amount]/+page.svelte
index 133eab91..a8b86718 100644
--- a/src/routes/(app)/send/bitcoin/[address]/[...amount]/+page.svelte
+++ b/src/routes/(app)/send/bitcoin/[address]/[...amount]/+page.svelte
@@ -150,8 +150,7 @@
bind:this={submit}
type="submit"
class="opacity-100 hover:opacity-80 rounded-2xl border py-3 font-bold mt-2 bg-black text-white px-4 w-24"
- disabled={loading}
- >
+ disabled={loading}>
{#if confirmed}
{$t("payments.send")}
{:else}
diff --git a/src/routes/(app)/send/fund/[name]/[...amount]/+page.svelte b/src/routes/(app)/send/fund/[name]/[...amount]/+page.svelte
index b6a4aa0c..240abc32 100644
--- a/src/routes/(app)/send/fund/[name]/[...amount]/+page.svelte
+++ b/src/routes/(app)/send/fund/[name]/[...amount]/+page.svelte
@@ -47,8 +47,7 @@
<div class="flex w-full">
<button
type="submit"
- class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24"
- >
+ class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24">
{#if loading}
<Spinner />
{:else}
diff --git a/src/routes/(app)/send/invoice/[id]/+page.svelte b/src/routes/(app)/send/invoice/[id]/+page.svelte
index 79367534..5a9dbe9a 100644
--- a/src/routes/(app)/send/invoice/[id]/+page.svelte
+++ b/src/routes/(app)/send/invoice/[id]/+page.svelte
@@ -144,8 +144,7 @@
{#if amount}
<button
type="submit"
- class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24"
- >
+ class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24">
{#if loading}
<Spinner />
{:else}
@@ -156,8 +155,7 @@
<button
type="button"
class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24"
- on:click={setAmount}
- >
+ on:click={setAmount}>
{$t("payments.next")}
</button>
{/if}
diff --git a/src/routes/(app)/send/lightning/[payreq]/+page.svelte b/src/routes/(app)/send/lightning/[payreq]/+page.svelte
index ce9649fa..0b9b19d1 100644
--- a/src/routes/(app)/send/lightning/[payreq]/+page.svelte
+++ b/src/routes/(app)/send/lightning/[payreq]/+page.svelte
@@ -74,8 +74,7 @@
<button
type="submit"
class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24"
- disabled={loading}
- >
+ disabled={loading}>
{#if loading}
<Spinner />
{:else}
@@ -92,9 +91,7 @@
<div
class="absolute right-[2px] top-[25px] text-gray-600 rounded-r-2xl p-4 h-[54px] my-auto border-l"
- >
- ⚡️
- </div>
+ >⚡️</div>
</div>
{:else}
<div class="flex w-full mt-5">
@@ -113,8 +110,7 @@
<button
type="submit"
class="bg-black text-white rounded-xl h-[48px] flex w-full justify-center items-center font-semibold
- opacity-100 hover:opacity-80"
- >
+ opacity-100 hover:opacity-80">
Next
</button>
</form>
diff --git a/src/routes/(app)/send/user/[username]/[...amount]/+page.svelte b/src/routes/(app)/send/user/[username]/[...amount]/+page.svelte
index 1ad2c458..c97d0377 100644
--- a/src/routes/(app)/send/user/[username]/[...amount]/+page.svelte
+++ b/src/routes/(app)/send/user/[username]/[...amount]/+page.svelte
@@ -83,8 +83,7 @@
{#if amount}
<button
type="submit"
- class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24"
- >
+ class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24">
{#if loading}
<Spinner />
{:else}
@@ -97,10 +96,7 @@
bind:this={next}
class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24"
on:click={setAmount}
- on:keydown={setAmount}
- >
- Next
- </button>
+ on:keydown={setAmount}> Next </button>
{/if}
</div>
</form>
diff --git a/src/routes/(app)/support/+page.svelte b/src/routes/(app)/support/+page.svelte
index 8d8bee1a..17a6063e 100644
--- a/src/routes/(app)/support/+page.svelte
+++ b/src/routes/(app)/support/+page.svelte
@@ -46,11 +46,10 @@
});
</script>
-<svelte:head>
- <script
- src="https://www.google.com/recaptcha/api.js?render=6LfCd8YkAAAAANmVJgzN3SQY3n3fv1RhiS5PgMYM"
- ></script>
-</svelte:head>
+<svelte:head
+ ><script
+ src="https://www.google.com/recaptcha/api.js?render=6LfCd8YkAAAAANmVJgzN3SQY3n3fv1RhiS5PgMYM"></script></svelte:head
+>
{#if user}
<AppHeader {data} />