Skip to content

Commit

Permalink
feat: add error page
Browse files Browse the repository at this point in the history
  • Loading branch information
qwerzl committed Dec 18, 2024
1 parent d371d32 commit 61ac93c
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/wet-steaks-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"enspire": patch
---

Add customized error page
44 changes: 44 additions & 0 deletions error.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<script setup lang="ts">
import type { NuxtError } from '#app'
const props = defineProps({
error: Object as () => NuxtError,
})
const handleError = () => reloadNuxtApp({ path: '/' })
</script>

<template>
<div class="min-h-screen flex items-center px-4 py-12 lg:px-12 md:px-8 sm:px-6 xl:px-16">
<div class="w-full grid">
<div class="col-start-1 row-start-1 w-full flex h-full items-center justify-center">
<div class="text-9xl text-foreground font-bold tracking-tighter opacity-10">
{{ props.error?.statusCode }}
</div>
</div>
<div class="col-start-1 row-start-1 w-full text-center space-y-6">
<div class="space-y-3">
<h1 class="text-4xl font-bold tracking-tighter sm:text-5xl">
Oops! Lost in Cyberspace
</h1>
<p class="text-gray-500">
Looks like you've ventured into the unknown digital realm. <br>
Don't worry, the error is reported and we'll fix it soon.
</p>
</div>
<div class="flex justify-center space-x-2">
<Button
@click="handleError"
>
Return to website
</Button>
<Button as-child variant="outline">
<NuxtLink to="https://github.com/Computerization/Enspire/issues">
View Ongoing Issues
</NuxtLink>
</Button>
</div>
</div>
</div>
</div>
</template>

0 comments on commit 61ac93c

Please sign in to comment.