aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsecondl1ght <[email protected]>2022-08-02 13:23:59 -0600
committersecondl1ght <[email protected]>2022-08-02 13:23:59 -0600
commitd99a3524fd2649f1a9ce3623333de56a99e06971 (patch)
tree1ece2aea5230a45790eeec9c7e023c57e6cfe225 /src
parent63a4af3686b7a81874a87259f6ec5dd44aa97e48 (diff)
downloadcoinos-ui-d99a3524fd2649f1a9ce3623333de56a99e06971.tar.gz
coinos-ui-d99a3524fd2649f1a9ce3623333de56a99e06971.zip
lots of updates, implementing design, refactoring, bug fixes and more
Diffstat (limited to 'src')
-rw-r--r--src/components/404.svelte4
-rw-r--r--src/components/About.svelte8
-rw-r--r--src/components/AppHeader.svelte2
-rw-r--r--src/components/Footer.svelte1
-rw-r--r--src/components/LandingHero.svelte4
-rw-r--r--src/lib/socket.js2
-rw-r--r--src/lib/utils.js45
-rw-r--r--src/routes/[username]/dashboard.svelte67
-rw-r--r--src/routes/[username]/index.svelte34
-rw-r--r--src/routes/[username]/receive.svelte22
-rw-r--r--src/routes/[username]/support.svelte45
-rw-r--r--src/routes/__error.svelte8
-rw-r--r--src/routes/__layout.svelte8
-rw-r--r--src/routes/community.svelte0
-rw-r--r--src/routes/index.svelte2
-rw-r--r--src/routes/invoice/[id].svelte312
-rw-r--r--src/routes/jobs.svelte28
-rw-r--r--src/routes/support.svelte5
18 files changed, 372 insertions, 225 deletions
diff --git a/src/components/404.svelte b/src/components/404.svelte
index 503316bb..426f1f96 100644
--- a/src/components/404.svelte
+++ b/src/components/404.svelte
@@ -5,10 +5,10 @@
<div class="flex justify-center items-center mt-20">
<div class="space-y-5 text-center">
<a href="/">
- <Icon icon="logo" />
+ <Icon icon="logo" style="mx-auto" />
</a>
- <Icon icon="question" style="mx-auto w-full" />
+ <Icon icon="question" style="mx-auto w-56" />
<h1 class="font-bold text-5xl">404</h1>
<p>Page not found.</p>
diff --git a/src/components/About.svelte b/src/components/About.svelte
index 3731bf9b..84e1761b 100644
--- a/src/components/About.svelte
+++ b/src/components/About.svelte
@@ -2,10 +2,10 @@
import { Image, Icon } from '$comp';
const aboutAdam = [
- 'Running Bitcoin since 2011',
+ 'Running bitcoin since 2011',
'20+ years web development experience in government and industry',
- 'Early Bitcoin Vancouver meetup organizer',
- 'Founder of The Bitcoin Co-op and early supporter of Decentral Vancouver',
+ 'Early bitcoin Vancouver meetup organizer',
+ 'Founder of The bitcoin Co-op and early supporter of Decentral Vancouver',
'Yogi, permaculturist, anarchist, decentralist',
'Husband, father, brother, son'
];
@@ -21,7 +21,7 @@
as a way to provide local merchants with a convenient way to accept bitcoin payments.
<br /><br />
The feature set has grown over the years to accomodate a wide variety of use cases with the goal
- of making it as easy as possible for anyone to get started using Bitcoin quickly, cheaply, and securely.
+ of making it as easy as possible for anyone to get started using bitcoin quickly, cheaply, and securely.
<br /><br />
</p>
<p class="w-full lg:w-5/12">
diff --git a/src/components/AppHeader.svelte b/src/components/AppHeader.svelte
index d0123650..7d029a21 100644
--- a/src/components/AppHeader.svelte
+++ b/src/components/AppHeader.svelte
@@ -8,7 +8,7 @@
export let avatarPosition = 'left-[calc(50vw-48px)]';
const menuButtons = [
- { title: 'Customers', icon: 'customers', goto: 'customers' },
+ // { title: 'Customers', icon: 'customers', goto: 'customers' },
{ title: 'Dashboard', icon: 'dash', goto: 'dashboard' },
{ title: 'Settings', icon: 'settings', goto: 'settings' },
{ title: 'Support', icon: 'support', goto: 'support' },
diff --git a/src/components/Footer.svelte b/src/components/Footer.svelte
index 0c682179..f1de0173 100644
--- a/src/components/Footer.svelte
+++ b/src/components/Footer.svelte
@@ -9,7 +9,6 @@
const companyLinks = [
{ url: 'mailto:[email protected]', title: 'Support' },
- { url: '/community', title: 'Community' },
{ url: '/jobs', title: 'Jobs' }
];
</script>
diff --git a/src/components/LandingHero.svelte b/src/components/LandingHero.svelte
index 93bea8c2..750f5626 100644
--- a/src/components/LandingHero.svelte
+++ b/src/components/LandingHero.svelte
@@ -12,12 +12,12 @@
The <span class="relative">
easiest
<Icon icon="rays" style="absolute -top-16 left-5 md:left-8 lg:left-14 2xl:left-24" />
- </span> way to accept Bitcoin in your store.
+ </span> way to accept bitcoin in your store.
</h1>
<h2
class="text-center text-secondary w-full md:w-3/5 lg:w-2/5 max-w-3xl mx-auto text-xl leading-normal font-medium"
>
- Grow your customer base and revenue by accepting Bitcoin with an easy-to-use and managed Point
+ Grow your customer base and revenue by accepting bitcoin with an easy-to-use and managed Point
of Sale. No software or hardware required.
</h2>
{#if !$user}
diff --git a/src/lib/socket.js b/src/lib/socket.js
index 66091d76..53adfe7c 100644
--- a/src/lib/socket.js
+++ b/src/lib/socket.js
@@ -25,7 +25,7 @@ export const messages = (data) => ({
login() {
user.set(data);
- preferredCurrency.set(data.currency);
+ preferredCurrency.set('USD');
}
});
diff --git a/src/lib/utils.js b/src/lib/utils.js
index db8a490a..6b728152 100644
--- a/src/lib/utils.js
+++ b/src/lib/utils.js
@@ -1,4 +1,5 @@
import { browser } from '$app/env';
+import { toast } from '@zerodevx/svelte-toast';
export function scroll(section) {
section.scrollIntoView({ behavior: 'smooth' });
@@ -26,6 +27,7 @@ export const post = (url, body) =>
export const copy = (text) => {
navigator.clipboard.writeText(text);
+ success('Copied!');
};
export function reverseFormat(val, locale) {
@@ -37,4 +39,45 @@ export function reverseFormat(val, locale) {
return Number.isNaN(reversedVal) ? 0 : +reversedVal;
}
-export let protectedRoutes = [/receive/, /customers/, /dashboard/, /settings/, /transactions/];
+export let protectedRoutes = [
+ /receive/,
+ /customers/,
+ /dashboard/,
+ /settings/,
+ /transactions/,
+ /support/
+];
+
+export const success = (m) => {
+ toast.pop();
+ toast.push(m, {
+ theme: {
+ '--toastBarBackground': '#16A34A'
+ }
+ });
+};
+
+export const warning = (m) => {
+ toast.pop();
+ toast.push(m, {
+ theme: {
+ '--toastBarBackground': '#FFCE22'
+ }
+ });
+};
+export const failure = (m) => {
+ toast.pop();
+ toast.push(m, {
+ theme: {
+ '--toastBarBackground': '#E93535'
+ }
+ });
+};
+export const info = (m) => {
+ toast.pop();
+ toast.push(m, {
+ theme: {
+ '--toastBarBackground': '#1C69FF'
+ }
+ });
+};
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 @@
<script>
import { AppHeader } from '$comp';
+ import { rate, user, preferredCurrency } from '$lib/store';
+
+ $: btcPrice = new Intl.NumberFormat('en-US', {
+ style: 'currency',
+ currency: 'USD'
+ }).format($rate);
+
+ $: accountBalanceFiat = new Intl.NumberFormat('en-US', {
+ style: 'currency',
+ currency: 'USD'
+ }).format($user.account.balance * ($rate / 100000000));
+
+ $: accountBalanceBtc = $user.account.balance / 100000000;
+
+ $: accountBalanceSats = new Intl.NumberFormat('en-US', { maximumFractionDigits: 0 }).format(
+ $user.account.balance
+ );
+
+ $: feeAmount = new Intl.NumberFormat('en-US', {
+ style: 'currency',
+ currency: 'USD'
+ }).format(($user.account.balance * ($rate / 100000000)) / 100);
</script>
-<AppHeader />
+{#if $user}
+ <AppHeader avatarPosition="left-[calc(50vw-48px)] lg:left-[calc(15vw-48px)]" />
+
+ <div
+ class="text-center mx-auto lg:text-left lg:mx-0 lg:ml-[calc(15vw-48px)] mt-12 w-full md:w-72"
+ >
+ <h2 class="text-2xl font-semibold">{$user.username}</h2>
+ <span class="text-secondary">Address goes here</span>
+ </div>
+
+ <div class="px-3 md:px-0 flex justify-center items-center mt-10 lg:mt-0 mb-20">
+ <div>
+ <h1 class="text-4xl font-semibold mb-8">Dashboard</h1>
+
+ <span class="text-secondary mx-auto text-lg font-bold"
+ >Bitcoin Price: <span class="text-black">{$rate ? btcPrice : 'fetching rate...'}</span>
+ {$preferredCurrency}
+ </span>
+
+ <span class="text-secondary block mt-1"
+ >Data from <span class="text-black">Binance</span>.
+ </span>
+
+ <h3 class="text-secondary font-bold border-b pb-1 mt-10 mb-6 w-full md:w-[500px]">
+ ACCOUNT BALANCE
+ </h3>
+
+ <span class="text-3xl font-bold block mb-1"
+ >{$rate ? accountBalanceFiat : 'fetching rate...'}</span
+ >
+
+ <span class="text-secondary text-xl block"
+ >{accountBalanceBtc} BTC ({accountBalanceSats} SATS)
+ </span>
+
+ <button class="rounded-full border py-2 font-bold w-28 mt-4">Withdraw</button>
+ <p class="text-secondary mt-2 w-full md:w-[550px]">
+ You will be charged a 1% withdrawal fee (<span class="text-black"
+ >{$rate ? feeAmount : 'fetching rate...'}</span
+ >) on your balance.
+ </p>
+ </div>
+ </div>
+{/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 @@
<script>
- import { toast } from '@zerodevx/svelte-toast';
import { browser } from '$app/env';
import { onMount } from 'svelte';
import { AppHeader, Icon, PageNotFound } from '$comp';
@@ -14,7 +13,7 @@
let { default: QRCodeStyling } = await import('qr-code-styling');
const qrCode = new QRCodeStyling({
width: window.screen.width < 640 ? 250 : 300,
- type: 'svg',
+ type: 'canvas',
data: 'add static qr here',
image: '/images/invoice.svg',
backgroundOptions: {
@@ -33,18 +32,6 @@
});
let followed = false;
-
- let qrSkeleton = true;
- setTimeout(() => (qrSkeleton = false), 100);
-
- const handleCopy = () => {
- copy(lightningAddress);
- toast.push('Copied!', {
- theme: {
- '--toastBarBackground': '#2F855A'
- }
- });
- };
</script>
{#if username}
@@ -57,33 +44,30 @@
<p class="text-secondary">Address goes here</p>
- <button
+ <!--
+ we need to hook this up
+ <button
class="border rounded-full py-2 w-28 font-semibold flex justify-center items-center text-sm"
on:click={() => (followed = !followed)}
><Icon icon={followed ? 'minus' : 'plus'} style="mr-1" />
{followed ? 'Remove' : 'Follow'}
</button>
+ -->
</div>
<div class="space-y-5 static xl:absolute top-[255px] left-[calc(50vw-150px)]">
<div
id="qr"
- class="border border-lightgrey rounded-3xl flex md:p-5 justify-center items-center relative"
- >
- <div
- class="z-100 h-[300px] md:h-[342px] w-[250px] md:w-[342px] animate-pulse absolute top-0 left-0 bg-gray-400 rounded-3xl {qrSkeleton
- ? 'block'
- : 'hidden'}"
- />
- </div>
+ class="w-[292px] md:w-[342px] h-[342px] border border-lightgrey rounded-3xl flex p-5 justify-center items-center relative"
+ />
- <p class="text-secondary text-center font-semibold">Scan to pay with Bitcoin</p>
+ <p class="text-secondary text-center font-semibold">Scan to pay with bitcoin</p>
<div
class="bg-primary font-semibold rounded-xl text-sm py-2 px-3 flex flex-wrap justify-center items-center"
>
<span>{lightningAddress}</span>
- <button on:click={handleCopy}>
+ <button on:click={() => copy(lightningAddress)}>
<Icon icon="copy" style="ml-2" />
</button>
</div>
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 @@
>
</div>
- <!-- error message -->
- {#if message}
- <div
- class="text-orange-500 text-sm text-center font-bold bg-primary p-2 rounded-xl flex justify-center items-center space-x-1"
- >
- <Icon icon="info" style="w-5" />
- <p>{message}</p>
- </div>
- {/if}
-
<!-- numpad -->
<div class="grid grid-cols-3 gap-2 w-full md:w-[300px] mx-auto">
{#each numPad as value}
@@ -172,10 +158,12 @@
on:click={submit}
disabled={$invoiceAmount === 0}><Icon icon="qr" style="mr-2" /> Show QR</button
>
+ <!--
<button
class="bg-primary rounded-xl w-full h-[48px] flex justify-center items-center font-semibold text-sm"
disabled={true}><Icon icon="send" style="mr-2" /> Send Invoice</button
>
+ -->
</div>
</div>
{: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 @@
+<script>
+ // this needs to be hooked up to the backend
+ import { AppHeader } from '$comp';
+ import { user } from '$lib/store';
+</script>
+
+{#if $user}
+ <AppHeader />
+
+ <div class="my-20">
+ <h1 class="text-center text-4xl font-semibold mb-10">Support</h1>
+
+ <form class="space-y-5 mx-auto w-11/12 md:w-[350px]">
+ <div>
+ <label for="email" class="font-semibold">Email</label>
+ <input class="block border rounded-xl p-2 w-full" type="email" name="email" required />
+ </div>
+
+ <div>
+ <label for="account" class="font-semibold">Account Name</label>
+ <input
+ class="block border rounded-xl p-2 w-full"
+ type="text"
+ name="account"
+ required
+ disabled
+ value={$user.username}
+ />
+ </div>
+
+ <div>
+ <label for="message" class="font-semibold">Message</label>
+ <textarea
+ rows={5}
+ class="block border rounded-xl p-2 w-full"
+ type="text"
+ name="message"
+ required
+ />
+ </div>
+
+ <button class="bg-black text-white font-bold rounded-xl py-3 w-full mx-auto">Send</button>
+ </form>
+ </div>
+{/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 @@
<script context="module">
export function load({ error, status }) {
if (error.message.includes('not found')) {
- error.message = 'Page not found';
+ error.message = 'Page not found.';
status = 404;
}
@@ -25,13 +25,13 @@
<div class="flex justify-center items-center mt-20">
<div class="space-y-5 text-center">
<a href="/">
- <Icon icon="logo" />
+ <Icon icon="logo" style="mx-auto" />
</a>
- <Icon icon="error" style="mx-auto w-full" />
+ <Icon icon="error" style="mx-auto w-56" />
<h1 class="font-bold text-5xl">Error</h1>
- <p>{error.message}</p>
+ <p class="px-1 w-full md:w-96 break-all font-bold">{error.message.toUpperCase()}</p>
<p>Please try again or contact support.</p>
</div>
</div>
diff --git a/src/routes/__layout.svelte b/src/routes/__layout.svelte
index 406c29e2..167fba93 100644
--- a/src/routes/__layout.svelte
+++ b/src/routes/__layout.svelte
@@ -1,6 +1,5 @@
<script>
import { SvelteToast } from '@zerodevx/svelte-toast';
- import { toast } from '@zerodevx/svelte-toast';
import '../app.css';
import { onMount } from 'svelte';
import { connect } from '$lib/socket';
@@ -9,18 +8,19 @@
import { browser } from '$app/env';
import { goto } from '$app/navigation';
import { LoadingSplash } from '$comp';
+ import { warning, protectedRoutes } from '$lib/utils';
browser && ($token ||= $session.token);
- let protectedRoutes = [/receive/, /customers/, /dashboard/, /settings/, /transactions/];
+
let ready = false;
onMount(() => {
if (protectedRoutes.find((p) => $page.url.pathname.match(p))) {
if (!$token) {
goto('/login');
- toast.push('Please sign in to continue.');
+ warning('Please sign in to continue.');
}
- user.subscribe((u) => (ready = true));
+ user.subscribe((u) => u?.username && (ready = true));
} else {
ready = true;
}
diff --git a/src/routes/community.svelte b/src/routes/community.svelte
deleted file mode 100644
index e69de29b..00000000
--- a/src/routes/community.svelte
+++ /dev/null
diff --git a/src/routes/index.svelte b/src/routes/index.svelte
index faa881bb..f50db726 100644
--- a/src/routes/index.svelte
+++ b/src/routes/index.svelte
@@ -23,7 +23,7 @@
{
image: 'bolt',
step: '2. Ask for payments',
- description: 'The same as you normally would, but with Bitcoin.'
+ description: 'The same as you normally would, but with bitcoin.'
},
{
image: 'smile',
diff --git a/src/routes/invoice/[id].svelte b/src/routes/invoice/[id].svelte
index 17c7de1f..126a474e 100644
--- a/src/routes/invoice/[id].svelte
+++ b/src/routes/invoice/[id].svelte
@@ -1,5 +1,4 @@
<script>
- import { toast } from '@zerodevx/svelte-toast';
import { get, post, reverseFormat } from '$lib/utils';
import { browser } from '$app/env';
import { invoices, user, preferredCurrency } from '$lib/store';
@@ -83,7 +82,6 @@
$: generate(text);
let generate = async (ready) => {
- console.log('GENERATE', text);
if (!ready) return;
let { default: QRCodeStyling } = await import('qr-code-styling');
@@ -122,15 +120,6 @@
let customInput;
- const handleCopy = () => {
- copy(text);
- toast.push('Copied!', {
- theme: {
- '--toastBarBackground': '#2F855A'
- }
- });
- };
-
const handleDoneClick = () => {
if ($user) {
goto(`/${$user.username}/receive`);
@@ -140,174 +129,185 @@
};
</script>
-{#if $invoices[id]?.status !== 'paid'}
- <div class:full-shadow={showMobileTip}>
- <button
- class="ml-5 md:ml-20 mt-5 md:mt-10"
- class:invisible={!$user}
- on:click={handleBackButton}
- >
- <Icon icon="arrow-left" style="w-10" />
- </button>
-
- <div class="flex justify-center items-center mb-20 md:mt-[20px] px-3">
- <div
- class="block lg:flex justify-center items-center space-y-10 lg:space-y-0 space-x-0 lg:space-x-24"
+{#if $user}
+ {#if $invoices[id]?.status !== 'paid'}
+ <div class:full-shadow={showMobileTip}>
+ <button
+ class="ml-5 md:ml-20 mt-5 md:mt-10"
+ class:invisible={!$user}
+ on:click={handleBackButton}
>
- <!-- tipping section -->
+ <Icon icon="arrow-left" style="w-10" />
+ </button>
+
+ <div class="flex justify-center items-center mb-20 md:mt-[20px] px-3">
<div
- class="w-[100%] md:w-auto absolute {showMobileTip
- ? 'bottom-0'
- : '-bottom-full'} bg-white p-6 md:p-0 rounded-t-3xl md:rounded-none transition-all md:transition-none ease-in-out duration-500 left-0 md:static text-center space-y-5"
+ class="block lg:flex justify-center items-center space-y-10 lg:space-y-0 space-x-0 lg:space-x-24"
>
- <h1 class="hidden md:block text-4xl font-semibold">Add a tip?</h1>
+ <!-- tipping section -->
+ <div
+ class="w-[100%] md:w-auto absolute {showMobileTip
+ ? 'bottom-0'
+ : '-top-full'} bg-white p-6 md:p-0 rounded-t-3xl md:rounded-none transition-all md:transition-none ease-in-out duration-500 left-0 md:static text-center space-y-5"
+ >
+ <h1 class="hidden md:block text-4xl font-semibold">Add a tip?</h1>
- <div>
- <span class="font-semibold mr-1">{tipAmountFormatted}</span><span
- class="text-secondary font-semibold text-sm">{`(${tipAmountSats} SATS)`}</span
- >
- <span class="block text-secondary text-sm">{tipPercent}%</span>
- </div>
+ <div>
+ <span class="font-semibold mr-1">{tipAmountFormatted}</span><span
+ class="text-secondary font-semibold text-sm">{`(${tipAmountSats} SATS)`}</span
+ >
+ <span class="block text-secondary text-sm">{tipPercent}%</span>
+ </div>
- <input
- id="slider"
- type="range"
- min="0"
- max="100"
- value={tipPercent}
- class="px-2"
- on:input={(e) => {
- customTipAmount = '';
- customInput.value = '';
- tipPercent = e.target.value;
- }}
- />
+ <input
+ id="slider"
+ type="range"
+ min="0"
+ max="100"
+ value={tipPercent}
+ class="px-2"
+ on:input={(e) => {
+ customTipAmount = '';
+ customInput.value = '';
+ tipPercent = e.target.value;
+ }}
+ />
- <div>
- {#each tipAmounts as amount}
- <button
- class="bg-primary w-16 md:w-20 py-3 m-1 rounded-2xl font-semibold {customTipAmount
- ? ''
- : tipPercent === amount.slice(0, 2) ||
- ((tipPercent === 0 || tipPercent === '0') && amount === 'None')
- ? '!bg-black text-white'
- : ''}"
- on:click={() => handleTipButtonClick(amount)}>{amount}</button
- >
- {/each}
+ <div>
+ {#each tipAmounts as amount}
+ <button
+ class="bg-primary w-16 md:w-20 py-3 m-1 rounded-2xl font-semibold {customTipAmount
+ ? ''
+ : tipPercent === amount.slice(0, 2) ||
+ ((tipPercent === 0 || tipPercent === '0') && amount === 'None')
+ ? '!bg-black text-white'
+ : ''}"
+ on:click={() => handleTipButtonClick(amount)}>{amount}</button
+ >
+ {/each}
- <div class="relative">
- <span
- class="absolute top-[20px] left-5 font-semibold {!customTipAmount
- ? 'opacity-50'
- : 'opacity-100'}">$</span
- >
- <input
- bind:this={customInput}
- type="number"
- min="0"
- on:input={(e) => handleCustomTipAmount(e)}
- class="bg-primary rounded-2xl py-3 px-10 font-semibold mt-2 mr-1 w-full md:w-auto"
- placeholder="Other"
- />
- <button
- class="w-full md:w-auto mt-2 md:mt-0 bg-black text-white font-semibold py-3 px-7 rounded-2xl {showMobileTip
- ? !customTipAmount && !tipAmount
+ <div class="relative">
+ <span
+ class="absolute top-[20px] left-5 font-semibold {!customTipAmount
? 'opacity-50'
- : 'opacity-100'
- : !customTipAmount
- ? 'opacity-50'
- : 'opacity-100'}"
- disabled={showMobileTip ? !customTipAmount && !tipAmount : !customTipAmount}
- on:click={() => (showMobileTip = false)}>Done</button
- >
+ : 'opacity-100'}">$</span
+ >
+ <input
+ bind:this={customInput}
+ type="number"
+ min="0"
+ on:input={(e) => handleCustomTipAmount(e)}
+ class="bg-primary rounded-2xl py-3 px-10 font-semibold mt-2 mr-1 w-full md:w-auto"
+ placeholder="Other"
+ />
+ <button
+ class="w-full md:w-auto mt-2 md:mt-0 bg-black text-white font-semibold py-3 px-7 rounded-2xl {showMobileTip
+ ? !customTipAmount && !tipAmount
+ ? 'opacity-50'
+ : 'opacity-100'
+ : !customTipAmount
+ ? 'opacity-50'
+ : 'opacity-100'}"
+ disabled={showMobileTip ? !customTipAmount && !tipAmount : !customTipAmount}
+ on:click={() => (showMobileTip = false)}>Done</button
+ >
+ </div>
</div>
</div>
- </div>
- <div
- class="hidden md:block h-[1px] lg:h-[600px] w-full lg:w-[1px] bg-lightgrey rounded-xl"
- id="section-divider"
- />
+ <div
+ class="hidden md:block h-[1px] lg:h-[600px] w-full lg:w-[1px] bg-lightgrey rounded-xl"
+ id="section-divider"
+ />
- <!-- invoice section -->
- <div class="text-center space-y-5">
- <button
- class="block md:hidden bg-black {showMobileTip
- ? 'text-white/50'
- : 'text-white'} rounded-xl px-6 py-3 block text-sm font-semibold mx-auto flex justify-center items-center"
- on:click={() => (showMobileTip = true)}
- disabled={showMobileTip}
- >
- <svg
- width="24"
- height="24"
- class="mr-1"
- viewBox="0 0 24 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
+ <!-- invoice section -->
+ <div class="text-center space-y-5">
+ <button
+ class="block md:hidden bg-black {showMobileTip
+ ? 'text-white/50'
+ : 'text-white'} rounded-xl px-6 py-3 block text-sm font-semibold mx-auto flex justify-center items-center"
+ on:click={() => (showMobileTip = true)}
+ disabled={showMobileTip}
>
- <path
- d="M4.31802 6.31802C2.56066 8.07538 2.56066 10.9246 4.31802 12.682L12.0001 20.364L19.682 12.682C21.4393 10.9246 21.4393 8.07538 19.682 6.31802C17.9246 4.56066 15.0754 4.56066 13.318 6.31802L12.0001 7.63609L10.682 6.31802C8.92462 4.56066 6.07538 4.56066 4.31802 6.31802Z"
- stroke="currentColor"
- stroke-width="2"
- stroke-linecap="round"
- stroke-linejoin="round"
- />
- </svg> Add a tip
- </button>
+ <svg
+ width="24"
+ height="24"
+ class="mr-1"
+ viewBox="0 0 24 24"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+ <path
+ d="M4.31802 6.31802C2.56066 8.07538 2.56066 10.9246 4.31802 12.682L12.0001 20.364L19.682 12.682C21.4393 10.9246 21.4393 8.07538 19.682 6.31802C17.9246 4.56066 15.0754 4.56066 13.318 6.31802L12.0001 7.63609L10.682 6.31802C8.92462 4.56066 6.07538 4.56066 4.31802 6.31802Z"
+ stroke="currentColor"
+ stroke-width="2"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ />
+ </svg> Add a tip
+ </button>
- <span class="text-secondary block"
- >Scan to pay <span class="text-black font-semibold">{username}</span></span
- >
+ <span class="text-secondary block"
+ >Scan to pay <a href="/{username}" class="text-black font-semibold">{username}</a
+ ></span
+ >
- <div
- bind:this={qr}
- on:click={handleCopy}
- class="border {showMobileTip
- ? 'border-gray-400'
- : 'border-lightgrey'} rounded-3xl block md:flex justify-center items-center cursor-pointer"
- />
+ <div
+ bind:this={qr}
+ on:click={() => 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"
+ />
- <div class="px-5 space-y-3">
- <div class="flex justify-between">
- <span class="font-semibold text-sm">Invoice</span>
- <span class="font-semibold text-sm"
- >{invoiceAmountFiatFormatted}
- <span class="text-secondary font-normal">{`(${amountFormatted} SATS)`}</span></span
- >
- </div>
+ <div class="px-5 space-y-3">
+ <div class="flex justify-between">
+ <span class="font-semibold text-sm">Invoice</span>
+ <span class="font-semibold text-sm"
+ >{invoiceAmountFiatFormatted}
+ <span class="text-secondary font-normal">{`(${amountFormatted} SATS)`}</span
+ ></span
+ >
+ </div>
- <div class="flex justify-between">
- <span class="font-semibold text-sm">Tip</span>
- <span class="font-semibold text-sm"
- >{tipAmountFormatted}
- <span class="text-secondary font-normal">{`(${tipAmountSats} SATS)`}</span></span
- >
- </div>
+ <div class="flex justify-between">
+ <span class="font-semibold text-sm">Tip</span>
+ <span class="font-semibold text-sm"
+ >{tipAmountFormatted}
+ <span class="text-secondary font-normal">{`(${tipAmountSats} SATS)`}</span></span
+ >
+ </div>
- <div class="flex justify-between">
- <span class="font-bold">Total</span>
- <span class="font-bold"
- >{totalAmountFormatted}
- <span class="text-secondary font-normal">{`(${totalAmountSats} SATS)`}</span></span
- >
+ <div class="flex justify-between">
+ <span class="font-bold">Total</span>
+ <span class="font-bold"
+ >{totalAmountFormatted}
+ <span class="text-secondary font-normal">{`(${totalAmountSats} SATS)`}</span
+ ></span
+ >
+ </div>
</div>
</div>
</div>
</div>
</div>
- </div>
-{:else}
- <div class="text-center mt-20 md:mt-0">
- <Image image="success" style="w-full md:w-3/4 xl:w-1/2 mx-auto max-w-3xl" />
- <h1 class="text-3xl md:text-4xl font-bold mb-6">Payment Successful!</h1>
- <h2 class="text-2xl md:text-3xl font-semibold">{totalAmountFormatted} {$preferredCurrency}</h2>
- <h3 class="text-secondary md:text-lg mb-6 mt-1">({totalAmountSats} SATS)</h3>
- <button class="bg-black text-white rounded-2xl w-20 py-3 font-bold" on:click={handleDoneClick}>
- Done
- </button>
- </div>
+ {:else}
+ <div class="text-center mt-20 md:mt-0">
+ <Image image="success" style="w-full md:w-3/4 xl:w-1/2 mx-auto max-w-3xl" />
+ <h1 class="text-3xl md:text-4xl font-bold mb-6">Payment Successful!</h1>
+ <h2 class="text-2xl md:text-3xl font-semibold">
+ {totalAmountFormatted}
+ {$preferredCurrency}
+ </h2>
+ <h3 class="text-secondary md:text-lg mb-6 mt-1">({totalAmountSats} SATS)</h3>
+ <button
+ class="bg-black text-white rounded-2xl w-20 py-3 font-bold"
+ on:click={handleDoneClick}
+ >
+ Done
+ </button>
+ </div>
+ {/if}
{/if}
<style>
diff --git a/src/routes/jobs.svelte b/src/routes/jobs.svelte
index e69de29b..e4a97386 100644
--- a/src/routes/jobs.svelte
+++ b/src/routes/jobs.svelte
@@ -0,0 +1,28 @@
+<script>
+ import { Icon } from '$comp';
+</script>
+
+<a href="/">
+ <Icon icon="logo" style="mx-auto mt-10" />
+</a>
+<div class="w-11/12 md:w-3/4 lg:w-1/2 2xl:w-1/3 max-w-3xl mx-auto my-20 space-y-5">
+ <h1 class="text-5xl font-medium">Jobs</h1>
+
+ <h2 class="text-2xl font-medium">Current Openings</h2>
+
+ <p class="text-justify text-xl text-secondary">
+ CoinOS is actively looking for developers to join our growing team (full-time or part-time,
+ remote working OK).
+ <br /><br />
+ Excited about working on open source bitcoin? Then take a look at our repositories on
+ <a
+ href="https://github.com/coinos"
+ target="_blank"
+ rel="noreferrer"
+ class="underline underline-offset-4">GitHub</a
+ >.
+ <br /><br />
+ If you think you can make an impact, we'd love to hear from you. Send us your resume to
+ <a href="mailto:[email protected]" class="underline underline-offset-4">[email protected]</a>.
+ </p>
+</div>
diff --git a/src/routes/support.svelte b/src/routes/support.svelte
deleted file mode 100644
index 1935b156..00000000
--- a/src/routes/support.svelte
+++ /dev/null
@@ -1,5 +0,0 @@
-<script>
- import { AppHeader } from '$comp';
-</script>
-
-<AppHeader />