diff options
| author | Fuwn <[email protected]> | 2024-02-11 00:15:59 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-02-11 00:15:59 -0800 |
| commit | 58d49767f4b68fa3f00ad1a51750d4a97b9067bf (patch) | |
| tree | 13369ed002368897863520f544e64bfe49d8bc77 /src/routes | |
| parent | feat(error): return partial matches first (diff) | |
| download | due.moe-58d49767f4b68fa3f00ad1a51750d4a97b9067bf.tar.xz due.moe-58d49767f4b68fa3f00ad1a51750d4a97b9067bf.zip | |
fix(error): use path store
Diffstat (limited to 'src/routes')
| -rw-r--r-- | src/routes/+error.svelte | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/routes/+error.svelte b/src/routes/+error.svelte index e8b9d0f1..03e5bfc0 100644 --- a/src/routes/+error.svelte +++ b/src/routes/+error.svelte @@ -1,8 +1,9 @@ <script lang="ts"> - import { browser } from '$app/environment'; + import { page } from '$app/stores'; import { closest } from '$lib/Error/path'; + import Popup from '$lib/Popup.svelte'; - $: suggestion = closest(browser ? window.location.pathname : '...', [ + $: suggestion = closest($page.url.pathname, [ 'birthdays', 'completed', 'schedule', @@ -15,12 +16,16 @@ ]); </script> -<p>Page not found.</p> +<Popup> + <p style="text-align: center;"> + <a href={$page.url.pathname}>{$page.url.pathname}</a> not found + </p> -<blockquote> - Did you mean "<a - href={suggestion} - style={suggestion === '...' ? 'pointer-events: none; color: inherit;' : ''} - >{suggestion.charAt(0).toUpperCase() + suggestion.slice(1)}</a - >"? -</blockquote> + <blockquote style="margin: 0 0 0 1.5rem;"> + Did you mean "<a + href={suggestion} + style={suggestion === '...' ? 'pointer-events: none; color: inherit;' : ''} + >{suggestion.charAt(0).toUpperCase() + suggestion.slice(1)}</a + >"? + </blockquote> +</Popup> |