aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes
diff options
context:
space:
mode:
authorsecondl1ght <[email protected]>2022-08-31 17:39:16 -0400
committersecondl1ght <[email protected]>2022-08-31 17:39:16 -0400
commitd24443114bccd4109df1dd6df621738f3f5e84ed (patch)
tree177954f7bc94956c46f00317f06b4b812f0841ed /src/routes
parentbd1e9ee212541c8f6236bea6256cad082b2ea35a (diff)
downloadcoinos-ui-d24443114bccd4109df1dd6df621738f3f5e84ed.tar.gz
coinos-ui-d24443114bccd4109df1dd6df621738f3f5e84ed.zip
style adjustments for settings
Diffstat (limited to 'src/routes')
-rw-r--r--src/routes/+layout.svelte4
-rw-r--r--src/routes/[username]/dashboard/+page.svelte2
-rw-r--r--src/routes/[username]/settings/+page.svelte5
-rw-r--r--src/routes/[username]/settings/_pos.svelte2
-rw-r--r--src/routes/[username]/settings/_security.svelte94
-rw-r--r--src/routes/disable2fa/+server.js2
-rw-r--r--src/routes/enable2fa/+server.js2
7 files changed, 57 insertions, 54 deletions
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index 80f233bb..ed26835d 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -52,5 +52,7 @@
--toastBackground: #292929;
}
- button.primary { @apply rounded-full border py-2 font-bold my-4 flex px-4 bg-white mx-auto hover:bg-primary }
+ button.primary {
+ @apply rounded-full border py-2 font-bold my-4 flex px-4 bg-white mx-auto hover:bg-primary;
+ }
</style>
diff --git a/src/routes/[username]/dashboard/+page.svelte b/src/routes/[username]/dashboard/+page.svelte
index bd5f2bba..e61360c9 100644
--- a/src/routes/[username]/dashboard/+page.svelte
+++ b/src/routes/[username]/dashboard/+page.svelte
@@ -48,7 +48,7 @@
<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">{user.address}</span>
+ <span class="text-secondary">{user.address}</span>
</div>
<div class="px-3 md:px-0 flex justify-center items-center mt-10 lg:mt-0 mb-20">
diff --git a/src/routes/[username]/settings/+page.svelte b/src/routes/[username]/settings/+page.svelte
index 8270ad51..037d44a5 100644
--- a/src/routes/[username]/settings/+page.svelte
+++ b/src/routes/[username]/settings/+page.svelte
@@ -30,7 +30,7 @@
<AppHeader />
-<form on:submit|preventDefault={save} class="mb-20">
+<form on:submit|preventDefault={save} class="mb-28">
<div class="my-20 px-3 md:px-0 w-full md:w-[400px] mx-auto space-y-8">
<h1 class="text-center text-3xl md:text-4xl font-semibold mb-10">
{$t('user.settings.header')}
@@ -46,11 +46,10 @@
<svelte:component this={comp} />
</div>
- <div class="fixed bottom-0 bg-white shadow border w-full">
+ <div class="z-10 fixed bottom-0 bg-white shadow border w-full">
<button type="submit" class="primary">
<Icon icon="save" style="w-6 h-6 mr-1" />
<div class="my-auto">Save Settings</div>
</button>
</div>
</form>
-
diff --git a/src/routes/[username]/settings/_pos.svelte b/src/routes/[username]/settings/_pos.svelte
index f44f8312..83a942bc 100644
--- a/src/routes/[username]/settings/_pos.svelte
+++ b/src/routes/[username]/settings/_pos.svelte
@@ -10,7 +10,7 @@
try {
$user.currency = e.target.value;
let r = await put('/' + $user.username, { user: $user });
- success('Local currency updated!');
+ success('Local currency updated');
} catch (e) {
failure(e.message);
}
diff --git a/src/routes/[username]/settings/_security.svelte b/src/routes/[username]/settings/_security.svelte
index dd184fe4..5b7aaf8e 100644
--- a/src/routes/[username]/settings/_security.svelte
+++ b/src/routes/[username]/settings/_security.svelte
@@ -27,7 +27,7 @@
await put('/enable2fa', { token });
success('2fa enabled');
$user.twofa = 1;
- toggleEnabling();
+ toggleEnabling();
}
} catch (e) {
failure('Failed to enable 2fa, try again');
@@ -41,7 +41,7 @@
await put('/disable2fa', { token });
success('2fa disabled');
$user.twofa = 0;
- toggleDisabling();
+ toggleDisabling();
}
} catch (e) {
failure('Failed to disable 2fa, try again');
@@ -88,50 +88,52 @@
</select>
</div>
-{#if setting2fa}
- <Qr text={$user.otpsecret} />
+<div>
+ {#if setting2fa}
+ <Qr text={$user.otpsecret} />
- <div class="text-center my-4">
- {$t('user.settings.accountId')}<br />
- <b>{$user.otpsecret}</b>
- </div>
- <div class="text-center my-4">
- {$t('user.settings.oneTimeCode')}<br />
- <Pincode bind:code bind:value={token} bind:this={tokenInput}>
- <PincodeInput />
- <PincodeInput />
- <PincodeInput />
- <PincodeInput />
- <PincodeInput />
- <PincodeInput />
- </Pincode>
- </div>
-{:else if disabling2fa}
- <div class="text-center my-4">
- {$t('user.settings.oneTimeCode')}<br />
- <Pincode bind:code bind:value={token} bind:this={tokenInput}>
- <PincodeInput />
- <PincodeInput />
- <PincodeInput />
- <PincodeInput />
- <PincodeInput />
- <PincodeInput />
- </Pincode>
- </div>
-{:else}
- <span class="font-bold mb-1">{$t('user.settings.twofa')}</span>
- <p class="text-secondary mb-1">
- {$t('user.settings.twofaDescription')}
- </p>
- {#if $user.twofa}
- <button type="button" class="primary" on:click={toggleDisabling}>
- <Icon icon="mobile" style="mr-1" />
- {$t('user.settings.twofaDisable')}
- </button>
+ <div class="text-center my-4">
+ {$t('user.settings.accountId')}<br />
+ <b>{$user.otpsecret}</b>
+ </div>
+ <div class="text-center my-4">
+ {$t('user.settings.oneTimeCode')}<br />
+ <Pincode bind:code bind:value={token} bind:this={tokenInput}>
+ <PincodeInput />
+ <PincodeInput />
+ <PincodeInput />
+ <PincodeInput />
+ <PincodeInput />
+ <PincodeInput />
+ </Pincode>
+ </div>
+ {:else if disabling2fa}
+ <div class="text-center my-4">
+ {$t('user.settings.oneTimeCode')}<br />
+ <Pincode bind:code bind:value={token} bind:this={tokenInput}>
+ <PincodeInput />
+ <PincodeInput />
+ <PincodeInput />
+ <PincodeInput />
+ <PincodeInput />
+ <PincodeInput />
+ </Pincode>
+ </div>
{:else}
- <button type="button" class="primary" on:click={toggleEnabling}>
- <Icon icon="mobile" style="mr-1" />
- {$t('user.settings.twofaSetup')}
- </button>
+ <span class="font-bold mb-1">{$t('user.settings.twofa')}</span>
+ <p class="text-secondary mb-1">
+ {$t('user.settings.twofaDescription')}
+ </p>
+ {#if $user.twofa}
+ <button type="button" class="primary" on:click={toggleDisabling}>
+ <Icon icon="mobile" style="mr-1" />
+ {$t('user.settings.twofaDisable')}
+ </button>
+ {:else}
+ <button type="button" class="primary" on:click={toggleEnabling}>
+ <Icon icon="mobile" style="mr-1" />
+ {$t('user.settings.twofaSetup')}
+ </button>
+ {/if}
{/if}
-{/if}
+</div>
diff --git a/src/routes/disable2fa/+server.js b/src/routes/disable2fa/+server.js
index 98063773..be09f3f4 100644
--- a/src/routes/disable2fa/+server.js
+++ b/src/routes/disable2fa/+server.js
@@ -1,7 +1,7 @@
import { auth, post } from '$lib/utils';
export async function PUT({ request }) {
- let body = await request.json();
+ let body = await request.json();
let res = await post('/disable2fa', body, auth(request));
return new Response(JSON.stringify(res));
diff --git a/src/routes/enable2fa/+server.js b/src/routes/enable2fa/+server.js
index 7bee4f4b..eb69a341 100644
--- a/src/routes/enable2fa/+server.js
+++ b/src/routes/enable2fa/+server.js
@@ -1,7 +1,7 @@
import { auth, post } from '$lib/utils';
export async function PUT({ request }) {
- let body = await request.json();
+ let body = await request.json();
let res = await post('/2fa', body, auth(request));
return new Response(JSON.stringify(res));