error.vue 1.4 KB

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