design: update error pages
This commit is contained in:
6 files changed
+36
-74
No files matched your search
@@ -956,7 +956,8 @@
|
||||
"rate_limit_error": "You are performing that action too fast.",
|
||||
"unimplemented": "That function of your account's server software is not yet supported by Photon.",
|
||||
"unsupported": "That function is not supported by your account's server software.",
|
||||
"not_live_supported": "That server is not running supported software, or is offline."
|
||||
"not_live_supported": "That server is not running supported software, or is offline.",
|
||||
"token_not_found": "That email verification link expired, or never existed."
|
||||
},
|
||||
"aria": {
|
||||
"pagination": {
|
||||
|
||||
+21
-24
@@ -3,7 +3,7 @@
|
||||
import { page } from '$app/state'
|
||||
import { errorMessage } from '$lib/app/error'
|
||||
import { t } from '$lib/app/i18n'
|
||||
import { Button } from 'mono-svelte'
|
||||
import { Button, Material } from 'mono-svelte'
|
||||
|
||||
function getError(message: string): { string: string; code: boolean } {
|
||||
try {
|
||||
@@ -15,33 +15,30 @@
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="flex flex-col gap-4 my-auto h-full justify-center max-w-md w-full mx-auto"
|
||||
class="flex flex-col gap-4 my-auto h-full justify-center max-w-xl w-full mx-auto"
|
||||
>
|
||||
<h1
|
||||
class="text-primary-900 dark:text-primary-100 text-6xl font-black flex items-center flex-row gap-2 font-mono"
|
||||
>
|
||||
{page.status}
|
||||
</h1>
|
||||
{#if page?.error?.message}
|
||||
{@const error = getError(page?.error?.message)}
|
||||
{#if error.code}
|
||||
<code class="rounded-md dark:bg-zinc-950! px-2 py-1 min-w-48">
|
||||
{error.string}
|
||||
</code>
|
||||
{:else}
|
||||
<p class="text-lg">
|
||||
{error.string}
|
||||
</p>
|
||||
<Material rounding="3xl" padding="xl" color="error" class="space-y-2">
|
||||
<h1 class="text-4xl font-medium flex items-center flex-row gap-2 font-mono">
|
||||
{page.status}
|
||||
</h1>
|
||||
{#if page?.error?.message}
|
||||
{@const error = getError(page?.error?.message)}
|
||||
{#if error.code}
|
||||
<code class="rounded-md dark:bg-zinc-950! px-2 py-1 min-w-48">
|
||||
{error.string}
|
||||
</code>
|
||||
{:else}
|
||||
<p class="text-lg">
|
||||
{error.string}
|
||||
</p>
|
||||
{/if}
|
||||
{/if}
|
||||
{/if}
|
||||
<div class="flex items-center gap-2">
|
||||
<Button
|
||||
rounding="xl"
|
||||
onclick={() => goto(page.url, { invalidateAll: true })}
|
||||
>
|
||||
</Material>
|
||||
<div class="flex items-center gap-2 px-4">
|
||||
<Button size="lg" onclick={() => goto(page.url, { invalidateAll: true })}>
|
||||
{$t('message.retry')}
|
||||
</Button>
|
||||
<Button rounding="xl" href="/">
|
||||
<Button href="/" size="lg">
|
||||
{$t('nav.home')}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
import { error } from '@sveltejs/kit'
|
||||
|
||||
export function load() {
|
||||
error(500, 'You asked for it.')
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
<script>
|
||||
import { page } from '$app/state'
|
||||
import { t } from '$lib/app/i18n'
|
||||
import { Icon, XMark } from 'svelte-hero-icons/dist'
|
||||
</script>
|
||||
|
||||
<div class="flex flex-col items-center h-max my-auto gap-2">
|
||||
<div
|
||||
class="rounded-full bg-red-200 dark:bg-red-900 text-red-600 dark:text-red-300 p-3"
|
||||
>
|
||||
<Icon src={XMark} size="32" mini />
|
||||
</div>
|
||||
<h1 class="text-red-800 dark:text-red-300 text-2xl font-semibold">
|
||||
{$t('message.error')}
|
||||
</h1>
|
||||
<code>{page.error?.message}</code>
|
||||
</div>
|
||||
@@ -1,18 +0,0 @@
|
||||
<script>
|
||||
import { page } from '$app/state'
|
||||
import { t } from '$lib/app/i18n'
|
||||
import { Icon, XMark } from 'svelte-hero-icons/dist'
|
||||
</script>
|
||||
|
||||
<div class="flex flex-col items-center h-max my-auto gap-2">
|
||||
<div
|
||||
class="rounded-full bg-red-200 dark:bg-red-900 text-red-600 dark:text-red-300 p-3"
|
||||
>
|
||||
<Icon src={XMark} size="32" mini />
|
||||
</div>
|
||||
<h1 class="text-red-800 dark:text-red-300 text-2xl font-semibold">
|
||||
{$t('message.error')}
|
||||
</h1>
|
||||
<p class="text-red-800 dark:text-red-300">{$t('routes.verifyEmail.error')}</p>
|
||||
<code>{page.error?.message}</code>
|
||||
</div>
|
||||
@@ -1,23 +1,17 @@
|
||||
<script>
|
||||
import { t } from '$lib/app/i18n'
|
||||
import { LINKED_INSTANCE_URL } from '$lib/app/instance.svelte'
|
||||
import { CheckCircle, Icon } from 'svelte-hero-icons/dist'
|
||||
import { Header } from '$lib/ui/layout'
|
||||
import { Material } from 'mono-svelte'
|
||||
</script>
|
||||
|
||||
<div class="flex flex-col h-max my-auto gap-2 max-w-xl mx-auto">
|
||||
<div
|
||||
class="rounded-full bg-green-200 dark:bg-green-500/20 text-white p-2 w-max"
|
||||
>
|
||||
<Icon src={CheckCircle} size="48" solid />
|
||||
</div>
|
||||
<h1
|
||||
class="text-green-800 dark:text-green-200 text-2xl font-medium tracking-tight"
|
||||
>
|
||||
{$t('message.success')}
|
||||
</h1>
|
||||
<p class="text-green-800 dark:text-green-200">
|
||||
{$t('routes.verifyEmail.message')}
|
||||
</p>
|
||||
<Material rounding="3xl" padding="xl" color="success" class="space-y-2">
|
||||
<Header>
|
||||
{$t('message.success')}
|
||||
</Header>
|
||||
<p class="text-lg">{$t('routes.verifyEmail.message')}</p>
|
||||
</Material>
|
||||
{#if !LINKED_INSTANCE_URL}
|
||||
<p>
|
||||
You somehow got to this menu despite not being linked here by the email.
|
||||
|
||||
Reference in new issue
Block a user