From d99a3524fd2649f1a9ce3623333de56a99e06971 Mon Sep 17 00:00:00 2001
From: secondl1ght <85003930+secondl1ght@users.noreply.github.com>
Date: Tue, 2 Aug 2022 13:23:59 -0600
Subject: lots of updates, implementing design, refactoring, bug fixes and more
---
src/routes/[username]/dashboard.svelte | 67 ++++++-
src/routes/[username]/index.svelte | 34 +---
src/routes/[username]/receive.svelte | 22 +--
src/routes/[username]/support.svelte | 45 +++++
src/routes/__error.svelte | 8 +-
src/routes/__layout.svelte | 8 +-
src/routes/community.svelte | 0
src/routes/index.svelte | 2 +-
src/routes/invoice/[id].svelte | 318 ++++++++++++++++-----------------
src/routes/jobs.svelte | 28 +++
src/routes/support.svelte | 5 -
11 files changed, 321 insertions(+), 216 deletions(-)
create mode 100644 src/routes/[username]/support.svelte
delete mode 100644 src/routes/community.svelte
delete mode 100644 src/routes/support.svelte
(limited to 'src/routes')
diff --git a/src/routes/[username]/dashboard.svelte b/src/routes/[username]/dashboard.svelte
index 1935b156..4c0e4cfc 100644
--- a/src/routes/[username]/dashboard.svelte
+++ b/src/routes/[username]/dashboard.svelte
@@ -1,5 +1,70 @@
-
+{#if $user}
+
+
+
+
{$user.username}
+ Address goes here
+
+
+
+
+
Dashboard
+
+
Bitcoin Price: {$rate ? btcPrice : 'fetching rate...'}
+ {$preferredCurrency}
+
+
+
Data from Binance.
+
+
+
+ ACCOUNT BALANCE
+
+
+
{$rate ? accountBalanceFiat : 'fetching rate...'}
+
+
{accountBalanceBtc} BTC ({accountBalanceSats} SATS)
+
+
+
+
+ You will be charged a 1% withdrawal fee ({$rate ? feeAmount : 'fetching rate...'}) on your balance.
+
+
+
+{/if}
diff --git a/src/routes/[username]/index.svelte b/src/routes/[username]/index.svelte
index 6002efdc..41d60849 100644
--- a/src/routes/[username]/index.svelte
+++ b/src/routes/[username]/index.svelte
@@ -1,5 +1,4 @@
{#if username}
@@ -57,33 +44,30 @@
Address goes here
-
+ -->
+ class="w-[292px] md:w-[342px] h-[342px] border border-lightgrey rounded-3xl flex p-5 justify-center items-center relative"
+ />
-
Scan to pay with Bitcoin
+
Scan to pay with bitcoin
{lightningAddress}
-
diff --git a/src/routes/[username]/receive.svelte b/src/routes/[username]/receive.svelte
index 50fddbed..f0fa0fbd 100644
--- a/src/routes/[username]/receive.svelte
+++ b/src/routes/[username]/receive.svelte
@@ -3,13 +3,12 @@
import { AppHeader, Icon } from '$comp';
import { goto } from '$app/navigation';
import { invoiceAmount, invoiceAmountFiat, rate, user } from '$lib/store';
- import { post } from '$lib/utils';
+ import { post, warning } from '$lib/utils';
import { page } from '$app/stores';
let useFiat = true;
let amountFiat = 0;
let amountSats = 0;
- let message = '';
$: amount = useFiat ? Math.round(amountFiat / ($rate / 100000000)) : amountSats;
@@ -33,9 +32,6 @@
const numPad = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '.', '0', '<'];
const handleInput = (value) => {
- if (message) {
- message = '';
- }
if (useFiat) {
if (amountFiat === 0 && value !== '.' && value !== '<' && value !== '0') {
amountFiat = value;
@@ -54,7 +50,7 @@
}
}
} else if (value !== '.' && value !== '<' && parseInt(amountFiat + value) > $rate) {
- message = 'Please enter an amount less than 1 bitcoin.';
+ warning('Please enter an amount less than 1 bitcoin.');
} else if (amountFiat !== 0 && amountFiat.match(/\.../)) {
return;
} else {
@@ -74,7 +70,7 @@
}
}
} else if (value !== '<' && parseInt(amountSats + value) > 100000000) {
- message = 'Please enter an amount less than 1 bitcoin.';
+ warning('Please enter an amount less than 1 bitcoin.');
} else {
amountSats = amountSats + value;
}
@@ -118,16 +114,6 @@
>
-
- {#if message}
-
- {/if}
-
{#each numPad as value}
@@ -172,10 +158,12 @@
on:click={submit}
disabled={$invoiceAmount === 0}> Show QR
+
{:else}
diff --git a/src/routes/[username]/support.svelte b/src/routes/[username]/support.svelte
new file mode 100644
index 00000000..7dd254c1
--- /dev/null
+++ b/src/routes/[username]/support.svelte
@@ -0,0 +1,45 @@
+
+
+{#if $user}
+
+
+
+{/if}
diff --git a/src/routes/__error.svelte b/src/routes/__error.svelte
index 2d617f9d..b62b158f 100644
--- a/src/routes/__error.svelte
+++ b/src/routes/__error.svelte
@@ -1,7 +1,7 @@
-{#if $invoices[id]?.status !== 'paid'}
-
-
-
-
-
-
-
+
-
+
+
+
+
-
Add a tip?
-
-
- {tipAmountFormatted}{`(${tipAmountSats} SATS)`}
- {tipPercent}%
-
-
-
{
- customTipAmount = '';
- customInput.value = '';
- tipPercent = e.target.value;
- }}
- />
+
+
+
Add a tip?
-
- {#each tipAmounts as amount}
- handleTipButtonClick(amount)}>{amount}
+ {tipAmountFormatted}{`(${tipAmountSats} SATS)`}
- {/each}
+ {tipPercent}%
+
-
-
$
-
handleCustomTipAmount(e)}
- class="bg-primary rounded-2xl py-3 px-10 font-semibold mt-2 mr-1 w-full md:w-auto"
- placeholder="Other"
- />
-
{
+ customTipAmount = '';
+ customInput.value = '';
+ tipPercent = e.target.value;
+ }}
+ />
+
+
+ {#each tipAmounts as amount}
+
handleTipButtonClick(amount)}>{amount}
+ {/each}
+
+
+ (showMobileTip = false)}>Done
+ : 'opacity-100'}">$
+ handleCustomTipAmount(e)}
+ class="bg-primary rounded-2xl py-3 px-10 font-semibold mt-2 mr-1 w-full md:w-auto"
+ placeholder="Other"
+ />
+ (showMobileTip = false)}>Done
+
-
-
-
-
-
-
-
(showMobileTip = true)}
- disabled={showMobileTip}
- >
- Add a tip
-
-
-
Scan to pay {username}
-
-
- Invoice
- {invoiceAmountFiatFormatted}
- {`(${amountFormatted} SATS)`}
-
-
-
-
Tip
-
{tipAmountFormatted}
- {`(${tipAmountSats} SATS)`}
+
+ (showMobileTip = true)}
+ disabled={showMobileTip}
+ >
+
+
+ Add a tip
+
+
+
Scan to pay {username}
-
-
Total
-
{totalAmountFormatted}
- {`(${totalAmountSats} SATS)`}
+
copy(text)}
+ class="border {showMobileTip
+ ? 'border-gray-400'
+ : 'border-lightgrey'} px-5 md:px-0 w-[292px] h-[302px] md:w-[300px] md:h-[300px] rounded-3xl block md:flex justify-center items-center cursor-pointer"
+ />
+
+
+
+ Invoice
+ {invoiceAmountFiatFormatted}
+ {`(${amountFormatted} SATS)`}
+
+
+
+ Tip
+ {tipAmountFormatted}
+ {`(${tipAmountSats} SATS)`}
+
+
+
+ Total
+ {totalAmountFormatted}
+ {`(${totalAmountSats} SATS)`}
+
-
-{:else}
-
-
-
Payment Successful!
- {totalAmountFormatted} {$preferredCurrency}
- ({totalAmountSats} SATS)
-
- Done
-
-
+ {:else}
+
+
+
Payment Successful!
+
+ {totalAmountFormatted}
+ {$preferredCurrency}
+
+ ({totalAmountSats} SATS)
+
+ Done
+
+
+ {/if}
{/if}