From 8c6649ad645dd335e4a3b474406df44152d17921 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/lib/socket.js | 2 +- src/lib/utils.js | 45 ++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 45 insertions(+), 2 deletions(-) (limited to 'src/lib') 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' + } + }); +}; -- cgit v1.2.3 From 2cf2375e172cfbabbf339575a2c29ba09be7b43a Mon Sep 17 00:00:00 2001 From: secondl1ght <85003930+secondl1ght@users.noreply.github.com> Date: Tue, 2 Aug 2022 20:23:00 -0600 Subject: add settings screen --- src/components/AppHeader.svelte | 19 +++- src/components/Toggle.svelte | 12 +++ src/components/index.js | 1 + src/lib/socket.js | 3 +- src/lib/store.js | 2 + src/routes/[username]/settings.svelte | 165 +++++++++++++++++++++++++++++- src/routes/[username]/transactions.svelte | 4 +- src/routes/__layout.svelte | 2 +- static/icons/lock.svg | 3 + static/icons/mobile.svg | 3 + 10 files changed, 204 insertions(+), 10 deletions(-) create mode 100644 src/components/Toggle.svelte create mode 100644 static/icons/lock.svg create mode 100644 static/icons/mobile.svg (limited to 'src/lib') diff --git a/src/components/AppHeader.svelte b/src/components/AppHeader.svelte index cc147b0d..ff8ede70 100644 --- a/src/components/AppHeader.svelte +++ b/src/components/AppHeader.svelte @@ -2,7 +2,7 @@ // we will want to dynamically use the users avatar on this screen if they have uploaded one import OutClick from 'svelte-outclick'; - import { user } from '$lib/store'; + import { user, newPayment, colorTheme } from '$lib/store'; import { goto } from '$app/navigation'; import { Icon } from '$comp'; @@ -28,7 +28,7 @@ }; -
+
diff --git a/src/components/Toggle.svelte b/src/components/Toggle.svelte new file mode 100644 index 00000000..85fd08d5 --- /dev/null +++ b/src/components/Toggle.svelte @@ -0,0 +1,12 @@ + + +