aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsecondl1ght <[email protected]>2022-08-24 19:51:31 -0400
committersecondl1ght <[email protected]>2022-08-24 19:51:31 -0400
commitf6ff5156b66efbb51ba046e37de65b466585124a (patch)
tree6fed2233ad80097cd75a2a0340f199f2c564eef0 /src
parent8f8f85983d2f4cb734ed15b33ebc140028711733 (diff)
downloadcoinos-ui-f6ff5156b66efbb51ba046e37de65b466585124a.tar.gz
coinos-ui-f6ff5156b66efbb51ba046e37de65b466585124a.zip
remove duplicate elements and format
Diffstat (limited to 'src')
-rw-r--r--src/components/About.svelte18
-rw-r--r--src/lib/translations/index.js46
-rw-r--r--src/routes/+layout.svelte4
-rw-r--r--src/routes/[username]/dashboard/+page.svelte13
-rw-r--r--src/routes/invoice/+server.js2
-rw-r--r--src/routes/invoice/[id]/+page.server.js1
6 files changed, 33 insertions, 51 deletions
diff --git a/src/components/About.svelte b/src/components/About.svelte
index 3cd25f8c..55fc34d1 100644
--- a/src/components/About.svelte
+++ b/src/components/About.svelte
@@ -54,14 +54,16 @@
</div>
</div>
- <ul class="w-full mx-auto md:w-[700px] lg:w-[500px] xl:w-auto text-secondary px-1 md:px-10 text-xl list-disc space-y-5">
- <li>{$t('about.founder.qualifications.bitcoin')}</li>
- <li>{$t('about.founder.qualifications.webDev')}</li>
- <li>{$t('about.founder.qualifications.bitcoinVancouver')}</li>
- <li>{$t('about.founder.qualifications.bitcoinCoop')}</li>
- <li>{$t('about.founder.qualifications.beliefs')}</li>
- <li>{$t('about.founder.qualifications.familialRelationships')}</li>
- </ul>
+ <ul
+ class="w-full mx-auto md:w-[700px] lg:w-[500px] xl:w-auto text-secondary px-1 md:px-10 text-xl list-disc space-y-5"
+ >
+ <li>{$t('about.founder.qualifications.bitcoin')}</li>
+ <li>{$t('about.founder.qualifications.webDev')}</li>
+ <li>{$t('about.founder.qualifications.bitcoinVancouver')}</li>
+ <li>{$t('about.founder.qualifications.bitcoinCoop')}</li>
+ <li>{$t('about.founder.qualifications.beliefs')}</li>
+ <li>{$t('about.founder.qualifications.familialRelationships')}</li>
+ </ul>
</div>
<div class="mt-20">
diff --git a/src/lib/translations/index.js b/src/lib/translations/index.js
index dc03c0b6..2b1f2481 100644
--- a/src/lib/translations/index.js
+++ b/src/lib/translations/index.js
@@ -3,42 +3,36 @@ import lang from './lang.json';
// setup loaders & translations from lang.json data
function createLocaleLoader(localeCode) {
- return {
- locale: localeCode,
- key: '',
- loader: async () => (
- await import(`../../locales/${localeCode}.json`)
- ).default
- };
+ return {
+ locale: localeCode,
+ key: '',
+ loader: async () => (await import(`../../locales/${localeCode}.json`)).default
+ };
}
const availableLocales = Object.keys(lang);
const translations = {};
for (let i = 0; i < availableLocales.length; i++) {
- translations[availableLocales[i]] = { lang };
+ translations[availableLocales[i]] = { lang };
}
const loaders = availableLocales.map(createLocaleLoader);
const config = {
initLocale: 'en',
- fallbackLocale: 'en',
- translations: translations,
- loaders: [
- {
- locale: 'en',
- key: '',
- loader: async () => (
- await import("../../locales/en.json")
- ).default
- },
- {
- locale: 'fr',
- key: '',
- loader: async () => (
- await import("../../locales/fr.json")
- ).default
- }
- ]
+ fallbackLocale: 'en',
+ translations: translations,
+ loaders: [
+ {
+ locale: 'en',
+ key: '',
+ loader: async () => (await import('../../locales/en.json')).default
+ },
+ {
+ locale: 'fr',
+ key: '',
+ loader: async () => (await import('../../locales/fr.json')).default
+ }
+ ]
};
export const { t, l, locales, locale } = new i18n(config);
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index 5eab20bd..3309393e 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -11,7 +11,7 @@
import { warning, protectedRoutes } from '$lib/utils';
import { t, locale } from '$lib/translations';
- const localeLocalStorageKey = 'sveltekit-i18n-locale';
+ const localeLocalStorageKey = 'sveltekit-i18n-locale';
$: $token = data.token;
@@ -21,7 +21,7 @@
$: $selectedRate = data.user && $rate * (data.rates[data.user.currency] / data.rates.USD);
onMount(() => {
- let localStorageLocale = localStorage.getItem(localeLocalStorageKey);
+ let localStorageLocale = localStorage.getItem(localeLocalStorageKey);
if (localStorageLocale) locale.set(localStorageLocale);
locale.subscribe((lng) => {
diff --git a/src/routes/[username]/dashboard/+page.svelte b/src/routes/[username]/dashboard/+page.svelte
index e4f6538e..969717df 100644
--- a/src/routes/[username]/dashboard/+page.svelte
+++ b/src/routes/[username]/dashboard/+page.svelte
@@ -110,19 +110,6 @@
: 'opacity-100'} rounded-2xl border py-3 font-bold w-full mt-2 bg-black text-white"
on:click={withdraw}>{$t('user.dashboard.send')}</button
>
-
- <div>
- <label for="note" class="font-bold mb-1 block">{$t('user.dashboard.optionalNote')}</label>
- <textarea name="note" rows={2} class="block rounded-2xl p-3 w-full bg-primary" />
- </div>
-
- <button
- disabled={!payreq}
- class="{!payreq
- ? 'opacity-50'
- : 'opacity-100'} rounded-2xl border py-3 font-bold w-full mt-2 bg-black text-white"
- on:click={withdraw}>{$t('user.dashboard.send')}</button
- >
</div>
{/if}
</div>
diff --git a/src/routes/invoice/+server.js b/src/routes/invoice/+server.js
index 4b961be9..3942904b 100644
--- a/src/routes/invoice/+server.js
+++ b/src/routes/invoice/+server.js
@@ -10,7 +10,7 @@ export async function POST({ request }) {
({ text } = await post('/lightning/invoice', { amount }, headers));
let invoice = { amount, currency, network, rate, tip, text };
- let { uuid } = await post('/invoice', { invoice, user: { username } }, headers);
+ let { uuid } = await post('/invoice', { invoice, user: { username } }, headers);
return new Response(JSON.stringify(uuid), { headers: { 'content-type': 'application/json' } });
}
diff --git a/src/routes/invoice/[id]/+page.server.js b/src/routes/invoice/[id]/+page.server.js
index d46d039b..5ab0069a 100644
--- a/src/routes/invoice/[id]/+page.server.js
+++ b/src/routes/invoice/[id]/+page.server.js
@@ -5,4 +5,3 @@ export async function load({ params }) {
let { id } = params;
return { id, invoice: await get(`/invoice?uuid=${id}`) };
}
-