misc: make guest account look better
This commit is contained in:
1 parent
23f0d7aeb4
commit
5dd187e32d
1 file changed
+45
-67
@@ -20,29 +20,8 @@
|
|||||||
|
|
||||||
let newInstance: string = $instance
|
let newInstance: string = $instance
|
||||||
let loading = false
|
let loading = false
|
||||||
</script>
|
|
||||||
|
|
||||||
<svelte:head>
|
async function changeGuestInstance() {
|
||||||
<title>Accounts</title>
|
|
||||||
</svelte:head>
|
|
||||||
|
|
||||||
{#if $profileData.profiles.length == 0}
|
|
||||||
<div class="h-full flex items-center justify-center">
|
|
||||||
<div
|
|
||||||
class="text-slate-600 dark:text-zinc-400 flex flex-col justify-center items-center py-8 gap-4"
|
|
||||||
>
|
|
||||||
<div class="flex flex-col items-center">
|
|
||||||
<Icon src={ArrowLeftOnRectangle} size="48" solid />
|
|
||||||
<h1 class="font-bold text-3xl">No accounts</h1>
|
|
||||||
</div>
|
|
||||||
<Button href="/login" size="lg">
|
|
||||||
<Icon slot="icon" src={ArrowLeftOnRectangle} size="16" mini />
|
|
||||||
Log in
|
|
||||||
</Button>
|
|
||||||
<div class="flex flex-row font-normal gap-2">
|
|
||||||
<TextInput
|
|
||||||
label="Guest instance"
|
|
||||||
on:change={async () => {
|
|
||||||
loading = true
|
loading = true
|
||||||
try {
|
try {
|
||||||
const valid = await validateInstance(newInstance.trim())
|
const valid = await validateInstance(newInstance.trim())
|
||||||
@@ -71,7 +50,30 @@
|
|||||||
$instance = newInstance
|
$instance = newInstance
|
||||||
}
|
}
|
||||||
loading = false
|
loading = false
|
||||||
}}
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<svelte:head>
|
||||||
|
<title>Accounts</title>
|
||||||
|
</svelte:head>
|
||||||
|
|
||||||
|
{#if $profileData.profiles.length == 0}
|
||||||
|
<div class="h-full flex items-center justify-center">
|
||||||
|
<div
|
||||||
|
class="text-slate-600 dark:text-zinc-400 flex flex-col justify-center items-center py-8 gap-4"
|
||||||
|
>
|
||||||
|
<div class="flex flex-col items-center">
|
||||||
|
<Icon src={ArrowLeftOnRectangle} size="48" solid />
|
||||||
|
<h1 class="font-bold text-3xl">No accounts</h1>
|
||||||
|
</div>
|
||||||
|
<Button href="/login" size="lg">
|
||||||
|
<Icon slot="icon" src={ArrowLeftOnRectangle} size="16" mini />
|
||||||
|
Log in
|
||||||
|
</Button>
|
||||||
|
<div class="flex flex-row font-normal gap-2">
|
||||||
|
<TextInput
|
||||||
|
label="Guest instance"
|
||||||
|
on:change={changeGuestInstance}
|
||||||
placeholder="Instance URL"
|
placeholder="Instance URL"
|
||||||
bind:value={newInstance}
|
bind:value={newInstance}
|
||||||
disabled={LINKED_INSTANCE_URL != undefined}
|
disabled={LINKED_INSTANCE_URL != undefined}
|
||||||
@@ -141,49 +143,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
<div class="flex flex-row gap-4 items-center py-4">
|
<div class="flex flex-row gap-4 items-center py-4">
|
||||||
<span class="font-bold flex flex-col">
|
<span class="font-bold flex flex-col">Guest</span>
|
||||||
Guest
|
|
||||||
<div class="flex flex-row font-normal gap-2">
|
|
||||||
<TextInput
|
|
||||||
on:change={async () => {
|
|
||||||
loading = true
|
|
||||||
try {
|
|
||||||
const valid = await validateInstance(newInstance.trim())
|
|
||||||
|
|
||||||
if (!valid) {
|
|
||||||
throw new Error('invalid instance')
|
|
||||||
}
|
|
||||||
|
|
||||||
toast({
|
|
||||||
content: 'Changed guest instance.',
|
|
||||||
type: ToastType.success,
|
|
||||||
})
|
|
||||||
} catch (err) {
|
|
||||||
toast({
|
|
||||||
content: 'Failed to contact that instance URL. Is it down?',
|
|
||||||
type: ToastType.error,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
$profileData.defaultInstance = newInstance
|
|
||||||
if ($currentProfile && $currentProfile.id == -1) {
|
|
||||||
$instance = newInstance
|
|
||||||
}
|
|
||||||
loading = false
|
|
||||||
}}
|
|
||||||
placeholder="Instance URL"
|
|
||||||
bind:value={newInstance}
|
|
||||||
disabled={LINKED_INSTANCE_URL != undefined}
|
|
||||||
/>
|
|
||||||
<Button
|
|
||||||
color="primary"
|
|
||||||
{loading}
|
|
||||||
disabled={loading || LINKED_INSTANCE_URL != undefined}
|
|
||||||
>
|
|
||||||
Change
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</span>
|
|
||||||
<div class="ml-auto" />
|
<div class="ml-auto" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
@@ -196,7 +156,25 @@
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</EditableList>
|
</EditableList>
|
||||||
<Button href="/login" size="lg" class="mt-auto">
|
<div class="mt-auto" />
|
||||||
|
<div class="flex flex-row font-normal gap-2">
|
||||||
|
<TextInput
|
||||||
|
on:change={changeGuestInstance}
|
||||||
|
placeholder="Instance URL"
|
||||||
|
label="Guest instance"
|
||||||
|
bind:value={newInstance}
|
||||||
|
disabled={LINKED_INSTANCE_URL != undefined}
|
||||||
|
/>
|
||||||
|
<Button
|
||||||
|
color="primary"
|
||||||
|
{loading}
|
||||||
|
disabled={loading || LINKED_INSTANCE_URL != undefined}
|
||||||
|
class="h-[42px] self-end"
|
||||||
|
>
|
||||||
|
Change
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
<Button href="/login" size="lg">
|
||||||
<Icon slot="icon" src={Plus} size="16" mini />
|
<Icon slot="icon" src={Plus} size="16" mini />
|
||||||
Add more
|
Add more
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
Reference in new issue
Block a user