Skip to content

Commit 1c4a418

Browse files
authored
feat: custom error page (#84)
Closes #35, #36
1 parent eff606c commit 1c4a418

File tree

2 files changed

+26
-8
lines changed

2 files changed

+26
-8
lines changed

frontend/components/Review/PageChrome.vue

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,8 @@
22
<div>
33
<TopBar>
44
{{ $route.params.org }}/{{ $route.params.repo }}#{{ $route.params.pull }}
5-
<div class="inline-block bg-slate-50 shadow-inner text-black px-2 py-1 rounded-sm text-xs">
6-
<ReviewLink
7-
v-if="data" :params="data.params"
8-
to="cards"
9-
/> | <ReviewLink
10-
v-if="data" :params="data.params"
11-
to="slides"
12-
/>
5+
<div v-if="data" class="inline-block bg-slate-50 shadow-inner text-black px-2 py-1 rounded-sm text-xs">
6+
<ReviewLink :params="data.params" to="cards" /> | <ReviewLink :params="data.params" to="slides" />
137
</div>
148
</TopBar>
159
<div class="relative" :class="height">

frontend/error.vue

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<template>
2+
<NuxtLayout>
3+
<div class="mx-auto max-w-3xl py-10">
4+
<div class="bg-orange-100 px-2 pb-2">
5+
<div class="text-xs text-center underline py-4">
6+
{{ error }}
7+
</div>
8+
<div class="bg-white p-4 text-center border border-orange-200 rounded">
9+
<button class="underline hover:no-underline" @click="handleError">
10+
go home
11+
</button>
12+
</div>
13+
</div>
14+
</div>
15+
</NuxtLayout>
16+
</template>
17+
18+
<script setup lang="ts">
19+
defineProps({
20+
error: { type: Object, required: true }
21+
});
22+
23+
const handleError = () => clearError({ redirect: '/' })
24+
</script>

0 commit comments

Comments
 (0)