Skip to content

Commit 61ac93c

Browse files
committed
feat: add error page
1 parent d371d32 commit 61ac93c

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

.changeset/wet-steaks-dream.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"enspire": patch
3+
---
4+
5+
Add customized error page

error.vue

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<script setup lang="ts">
2+
import type { NuxtError } from '#app'
3+
4+
const props = defineProps({
5+
error: Object as () => NuxtError,
6+
})
7+
8+
const handleError = () => reloadNuxtApp({ path: '/' })
9+
</script>
10+
11+
<template>
12+
<div class="min-h-screen flex items-center px-4 py-12 lg:px-12 md:px-8 sm:px-6 xl:px-16">
13+
<div class="w-full grid">
14+
<div class="col-start-1 row-start-1 w-full flex h-full items-center justify-center">
15+
<div class="text-9xl text-foreground font-bold tracking-tighter opacity-10">
16+
{{ props.error?.statusCode }}
17+
</div>
18+
</div>
19+
<div class="col-start-1 row-start-1 w-full text-center space-y-6">
20+
<div class="space-y-3">
21+
<h1 class="text-4xl font-bold tracking-tighter sm:text-5xl">
22+
Oops! Lost in Cyberspace
23+
</h1>
24+
<p class="text-gray-500">
25+
Looks like you've ventured into the unknown digital realm. <br>
26+
Don't worry, the error is reported and we'll fix it soon.
27+
</p>
28+
</div>
29+
<div class="flex justify-center space-x-2">
30+
<Button
31+
@click="handleError"
32+
>
33+
Return to website
34+
</Button>
35+
<Button as-child variant="outline">
36+
<NuxtLink to="https://github.com/Computerization/Enspire/issues">
37+
View Ongoing Issues
38+
</NuxtLink>
39+
</Button>
40+
</div>
41+
</div>
42+
</div>
43+
</div>
44+
</template>

0 commit comments

Comments
 (0)