aboutsummaryrefslogtreecommitdiffstats
path: root/src/components
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-09-12 15:23:45 -0700
committerAdam Soltys <[email protected]>2024-09-17 09:19:25 -0700
commit2114156be3f89a2ef4c5bd13fd6d7a51d8fbc135 (patch)
treeae764021c0f9017493366862d42ea6cac904a76e /src/components
parent1f63848ca9fb01336f04b41434de1cc06a5b3d93 (diff)
downloadcoinos-ui-2114156be3f89a2ef4c5bd13fd6d7a51d8fbc135.tar.gz
coinos-ui-2114156be3f89a2ef4c5bd13fd6d7a51d8fbc135.zip
self custodial send
Diffstat (limited to 'src/components')
-rw-r--r--src/components/Account.svelte17
-rw-r--r--src/components/LandingHeader.svelte16
-rw-r--r--src/components/Request.svelte39
3 files changed, 16 insertions, 56 deletions
diff --git a/src/components/Account.svelte b/src/components/Account.svelte
index eb1b0bac..f83068b5 100644
--- a/src/components/Account.svelte
+++ b/src/components/Account.svelte
@@ -1,4 +1,5 @@
<script>
+ import { account as acc } from "$lib/store";
import Icon from "$comp/Icon.svelte";
import Balance from "$comp/Balance.svelte";
import { t } from "$lib/translations";
@@ -6,19 +7,17 @@
export let user, rate, account;
let { seed, balance, id } = account;
$: type = seed ? "Savings" : "Cash";
+
+ let setAccount = () =>
+ document.cookie = `account=${id}; path=/; max-age=86400`;
</script>
-<a href={`/payments`} class="block">
+<a href={`/payments`} class="block" on:click={setAccount}>
<div class="border rounded-xl shadow p-4 space-y-5">
- <div class="flex justify-center lg:justify-start">
- <Balance {balance} {user} {rate} />
- <div class="ml-auto text-right">
- <div>{type} account</div>
- </div>
- </div>
+ <Balance {balance} {user} {rate} />
<div class="flex flex-wrap gap-3 justify-center w-full text-xl">
- <a href={`/send`} class="contents grow">
+ <a href={`/send`} class="contents grow" on:click={setAccount}>
<button
type="button"
class="rounded-2xl border py-5 px-6 font-bold hover:opacity-80 flex bg-primary grow"
@@ -30,7 +29,7 @@
</button>
</a>
- <a href={`/invoice`} class="contents">
+ <a href={`/invoice?account=${id}`} class="contents" on:click={setAccount}>
<button
class="rounded-2xl border py-5 px-6 font-bold hover:opacity-80 flex bg-primary grow"
>
diff --git a/src/components/LandingHeader.svelte b/src/components/LandingHeader.svelte
index 92de7bcd..72913999 100644
--- a/src/components/LandingHeader.svelte
+++ b/src/components/LandingHeader.svelte
@@ -19,22 +19,22 @@
</script>
<header
- class="w-full md:w-5/6 py-5 mx-auto fixed md:sticky z-10 top-0 bg-white/90"
+ class="w-full lg:w-5/6 py-5 mx-auto fixed sticky z-10 top-0 bg-white/90"
bind:this={header}
>
- <nav class="block md:flex justify-between items-center">
+ <nav class="block lg:flex justify-between items-center">
<div
- class="flex justify-start md:justify-center items-center md:space-x-10"
+ class="flex justify-start lg:justify-center items-center lg:space-x-10"
>
<a href="/" on:click={() => scroll(header)}>
- <Icon icon="logo" style="hidden md:block mb-5 xl:mb-0" />
- <Icon icon="logo" style="block md:hidden ml-5 w-48" />
+ <Icon icon="logo" style="hidden lg:block mb-5 xl:mb-0" />
+ <Icon icon="logo" style="block lg:hidden ml-5 w-48" />
</a>
</div>
<!-- desktop nav -->
<div
- class="hidden space-x-10 md:flex justify-center items-center font-bold"
+ class="hidden space-x-10 lg:flex justify-center items-center font-bold"
>
{#if $page.url.pathname === "/"}
<button class="hover:opacity-80" on:click={() => scroll(howItWorks)}
@@ -76,13 +76,13 @@
<!-- mobile nav -->
<button
- class="block md:hidden absolute top-[34.5px] right-10 z"
+ class="block lg:hidden absolute top-[34.5px] right-10 z"
on:click={() => (showMobileMenu = !showMobileMenu)}
><Icon icon={!showMobileMenu ? "menu" : "close"} />
</button>
<div
- class="container w-full px-10 md:hidden absolute top-0 {showMobileMenu
+ class="container w-full px-10 lg:hidden absolute top-0 {showMobileMenu
? 'right-0'
: 'right-[-100%]'} transition-all ease-in-out duration-300 h-[100vh] w-full bg-white"
>
diff --git a/src/components/Request.svelte b/src/components/Request.svelte
deleted file mode 100644
index 297b7438..00000000
--- a/src/components/Request.svelte
+++ /dev/null
@@ -1,39 +0,0 @@
-<script>
- import { t } from "$lib/translations";
- import { fly } from "svelte/transition";
-
- import Avatar from "$comp/Avatar.svelte";
- import Icon from "$comp/Icon.svelte";
-
- import { request, requestRedirect } from "$lib/store";
- import { page } from "$app/stores";
-
- export let user;
-
- $requestRedirect = $page.url.pathname;
-</script>
-
-{#if $request}
- <div class="fixed bottom-0 border-t w-full p-4 bg-white z-50" in:fly>
- <div class="flex flex-wrap md:flex-nowrap max-w-xl mx-auto gap-2">
- <div class="my-auto mx-auto">
- <div class="flex">
- <Avatar user={$request.requester} size={12} />
- <h1 class="my-auto">
- <b>{$request.requester.username}</b>
- {$t("payments.readyToPay")}
- </h1>
- </div>
- </div>
- <div class="mx-auto my-auto flex gap-2">
- <a href={`/receive/${$request.id}`}>
- <button
- class="rounded-full border py-2 px-4 font-bold hover:opacity-80 w-32"
- >
- {$t("payments.invoice")}
- </button>
- </a>
- </div>
- </div>
- </div>
-{/if}