error.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <div class="page page-error">
  3. <h1 class="mb-4 text-4xl heading">{{ statusCode }}</h1>
  4. <h3 class="select-text">{{ message }}</h3>
  5. <p class="mt-4">
  6. <ButtonSecondary to="/" svg="home" filled :label="$t('app.home')" />
  7. <ButtonSecondary
  8. svg="refresh-cw"
  9. :label="$t('app.reload')"
  10. filled
  11. @click.native="reloadApplication"
  12. />
  13. </p>
  14. </div>
  15. </template>
  16. <script>
  17. import { defineComponent } from "@nuxtjs/composition-api"
  18. import { initializeFirebase } from "~/helpers/fb"
  19. export default defineComponent({
  20. props: {
  21. error: {
  22. type: Object,
  23. default: null,
  24. },
  25. },
  26. computed: {
  27. statusCode() {
  28. return (this.error && this.error.statusCode) || 500
  29. },
  30. message() {
  31. return this.error.message || this.$t("error.something_went_wrong")
  32. },
  33. },
  34. beforeMount() {
  35. initializeFirebase()
  36. },
  37. methods: {
  38. reloadApplication() {
  39. window.location.reload()
  40. },
  41. },
  42. })
  43. </script>
  44. <style scoped lang="scss">
  45. .page-error {
  46. @apply flex flex-col;
  47. @apply items-center;
  48. @apply justify-center;
  49. @apply text-center;
  50. }
  51. .error_banner {
  52. @apply w-24;
  53. @apply mb-12;
  54. }
  55. </style>