Skip to content

Commit

Permalink
feat: custom error page (#84)
Browse files Browse the repository at this point in the history
Closes #35, #36
  • Loading branch information
stanistan authored Jul 7, 2023
1 parent eff606c commit 1c4a418
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
10 changes: 2 additions & 8 deletions frontend/components/Review/PageChrome.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,8 @@
<div>
<TopBar>
{{ $route.params.org }}/{{ $route.params.repo }}#{{ $route.params.pull }}
<div class="inline-block bg-slate-50 shadow-inner text-black px-2 py-1 rounded-sm text-xs">
<ReviewLink
v-if="data" :params="data.params"
to="cards"
/> | <ReviewLink
v-if="data" :params="data.params"
to="slides"
/>
<div v-if="data" class="inline-block bg-slate-50 shadow-inner text-black px-2 py-1 rounded-sm text-xs">
<ReviewLink :params="data.params" to="cards" /> | <ReviewLink :params="data.params" to="slides" />
</div>
</TopBar>
<div class="relative" :class="height">
Expand Down
24 changes: 24 additions & 0 deletions frontend/error.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<template>
<NuxtLayout>
<div class="mx-auto max-w-3xl py-10">
<div class="bg-orange-100 px-2 pb-2">
<div class="text-xs text-center underline py-4">
{{ error }}
</div>
<div class="bg-white p-4 text-center border border-orange-200 rounded">
<button class="underline hover:no-underline" @click="handleError">
go home
</button>
</div>
</div>
</div>
</NuxtLayout>
</template>

<script setup lang="ts">
defineProps({
error: { type: Object, required: true }
});
const handleError = () => clearError({ redirect: '/' })
</script>

0 comments on commit 1c4a418

Please sign in to comment.