misc: add ref to /accounts for login buttons
This commit is contained in:
1 parent
d567e7e45e
commit
7c7df02e3d
5 files changed
+55
-8
No files matched your search
@@ -114,12 +114,12 @@
|
|||||||
<h1 class="font-bold text-3xl">No accounts</h1>
|
<h1 class="font-bold text-3xl">No accounts</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-row items-center gap-2">
|
<div class="flex flex-row items-center gap-2">
|
||||||
<Button href="/login" size="lg">
|
<Button href="/accounts/login" size="lg">
|
||||||
<Icon slot="prefix" src={ArrowLeftOnRectangle} size="16" mini />
|
<Icon slot="prefix" src={ArrowLeftOnRectangle} size="16" micro />
|
||||||
Log in
|
Log in
|
||||||
</Button>
|
</Button>
|
||||||
<Button href="/signup" size="lg">
|
<Button href="/signup" size="lg">
|
||||||
<Icon slot="prefix" src={Identification} size="16" mini />
|
<Icon slot="prefix" src={Identification} size="16" micro />
|
||||||
Sign up
|
Sign up
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
@@ -131,13 +131,18 @@
|
|||||||
{$t('routes.accounts')}
|
{$t('routes.accounts')}
|
||||||
<div class="flex" slot="extended">
|
<div class="flex" slot="extended">
|
||||||
<div class="flex gap-2 mr-auto">
|
<div class="flex gap-2 mr-auto">
|
||||||
<Button href="/login" size="lg" class="flex-1 px-8" color="primary">
|
<Button
|
||||||
|
href="/accounts/login"
|
||||||
|
size="lg"
|
||||||
|
class="flex-1 px-8"
|
||||||
|
color="primary"
|
||||||
|
>
|
||||||
<Icon slot="prefix" src={ArrowLeftOnRectangle} size="16" mini />
|
<Icon slot="prefix" src={ArrowLeftOnRectangle} size="16" mini />
|
||||||
{$t('account.login')}
|
{$t('account.login')}
|
||||||
</Button>
|
</Button>
|
||||||
{#if !LINKED_INSTANCE_URL}
|
{#if !LINKED_INSTANCE_URL}
|
||||||
<Button href="/login/guest" size="lg">
|
<Button href="/accounts/login/guest" size="lg">
|
||||||
<Icon slot="prefix" src={Plus} size="16" mini />
|
<Icon slot="prefix" src={Plus} size="16" micro />
|
||||||
{$t('account.addGuest')}
|
{$t('account.addGuest')}
|
||||||
</Button>
|
</Button>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import { Button } from 'mono-svelte'
|
||||||
|
import LoginPage from '../../login/+page.svelte'
|
||||||
|
import { ArrowLeft, Icon } from 'svelte-hero-icons'
|
||||||
|
import { t } from '$lib/translations'
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<LoginPage ref="/accounts">
|
||||||
|
<Button
|
||||||
|
size="custom"
|
||||||
|
color="none"
|
||||||
|
class="w-max hover:underline text-slate-600 dark:text-zinc-400"
|
||||||
|
on:click={() => history?.back()}
|
||||||
|
>
|
||||||
|
<Icon src={ArrowLeft} size="16" micro />
|
||||||
|
{$t('account.accounts')}
|
||||||
|
</Button>
|
||||||
|
</LoginPage>
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import { Button } from 'mono-svelte'
|
||||||
|
import LoginPage from '../../../login/guest/+page.svelte'
|
||||||
|
import { ArrowLeft, Icon } from 'svelte-hero-icons'
|
||||||
|
import { t } from '$lib/translations'
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<LoginPage ref="/accounts">
|
||||||
|
<Button
|
||||||
|
size="custom"
|
||||||
|
color="none"
|
||||||
|
class="w-max hover:underline text-slate-600 dark:text-zinc-400"
|
||||||
|
on:click={() => history?.back()}
|
||||||
|
>
|
||||||
|
<Icon src={ArrowLeft} size="16" micro />
|
||||||
|
{$t('account.accounts')}
|
||||||
|
</Button>
|
||||||
|
</LoginPage>
|
||||||
@@ -27,6 +27,8 @@
|
|||||||
} from '$lib/components/error/ErrorContainer.svelte'
|
} from '$lib/components/error/ErrorContainer.svelte'
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/stores'
|
||||||
|
|
||||||
|
export let ref: string = '/'
|
||||||
|
|
||||||
let data = {
|
let data = {
|
||||||
instance: DEFAULT_INSTANCE_URL,
|
instance: DEFAULT_INSTANCE_URL,
|
||||||
username: '',
|
username: '',
|
||||||
@@ -57,7 +59,7 @@
|
|||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
toast({ content: $t('toast.logIn'), type: 'success' })
|
toast({ content: $t('toast.logIn'), type: 'success' })
|
||||||
goto('/')
|
goto(ref)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new Error('Invalid credentials')
|
throw new Error('Invalid credentials')
|
||||||
@@ -89,6 +91,7 @@
|
|||||||
<div class="max-w-xl w-full mx-auto h-max my-auto">
|
<div class="max-w-xl w-full mx-auto h-max my-auto">
|
||||||
<form on:submit|preventDefault={logIn} class="flex flex-col gap-5">
|
<form on:submit|preventDefault={logIn} class="flex flex-col gap-5">
|
||||||
<div class="flex flex-col">
|
<div class="flex flex-col">
|
||||||
|
<slot />
|
||||||
<Header>{$t('account.login')}</Header>
|
<Header>{$t('account.login')}</Header>
|
||||||
{#if $site && mayBeIncompatible(MINIMUM_VERSION, $site.version.replace('v', ''))}
|
{#if $site && mayBeIncompatible(MINIMUM_VERSION, $site.version.replace('v', ''))}
|
||||||
<Note>
|
<Note>
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
import { t } from '$lib/translations'
|
import { t } from '$lib/translations'
|
||||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||||
|
|
||||||
|
export let ref: string = '/'
|
||||||
|
|
||||||
let form = {
|
let form = {
|
||||||
instance: '',
|
instance: '',
|
||||||
username: `${$t('account.guest')} ${$profileData.profiles.filter((p) => p.jwt == undefined).length + 1}`,
|
username: `${$t('account.guest')} ${$profileData.profiles.filter((p) => p.jwt == undefined).length + 1}`,
|
||||||
@@ -42,7 +44,7 @@
|
|||||||
|
|
||||||
toast({ content: $t('toast.addAccount'), type: 'success' })
|
toast({ content: $t('toast.addAccount'), type: 'success' })
|
||||||
|
|
||||||
goto('/')
|
goto(ref)
|
||||||
|
|
||||||
form.loading = false
|
form.loading = false
|
||||||
}
|
}
|
||||||
@@ -51,6 +53,7 @@
|
|||||||
<div class="max-w-xl w-full mx-auto h-max my-auto">
|
<div class="max-w-xl w-full mx-auto h-max my-auto">
|
||||||
<form on:submit|preventDefault={addGuest} class="flex flex-col gap-5">
|
<form on:submit|preventDefault={addGuest} class="flex flex-col gap-5">
|
||||||
<div class="flex flex-col gap-2">
|
<div class="flex flex-col gap-2">
|
||||||
|
<slot />
|
||||||
<Header>{$t('account.addGuest')}</Header>
|
<Header>{$t('account.addGuest')}</Header>
|
||||||
{#if $site && mayBeIncompatible(MINIMUM_VERSION, $site.version.replace('v', ''))}
|
{#if $site && mayBeIncompatible(MINIMUM_VERSION, $site.version.replace('v', ''))}
|
||||||
<Note>
|
<Note>
|
||||||
|
|||||||
Reference in new issue
Block a user