aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
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/lib
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/lib')
-rw-r--r--src/lib/socket.js2
-rw-r--r--src/lib/utils.js45
2 files changed, 45 insertions, 2 deletions
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'
+ }
+ });
+};