LayoutTestMobileView.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <!-- Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/ -->
  2. <script setup lang="ts">
  3. import { computed, unref } from 'vue'
  4. import { useRoute } from 'vue-router'
  5. import CommonImageViewer from '#shared/components/CommonImageViewer/CommonImageViewer.vue'
  6. import CommonNotifications from '#shared/components/CommonNotifications/CommonNotifications.vue'
  7. import DynamicInitializer from '#shared/components/DynamicInitializer/DynamicInitializer.vue'
  8. import useAuthenticationChanges from '#shared/composables/authentication/useAuthenticationUpdates.ts'
  9. import CommonConfirmation from '#mobile/components/CommonConfirmation/CommonConfirmation.vue'
  10. import LayoutHeader, {
  11. type Props as HeaderProps,
  12. } from '#mobile/components/layout/LayoutHeader.vue'
  13. import { headerOptions as header } from '#mobile/composables/useHeader.ts'
  14. defineProps<{ testKey: number }>()
  15. const route = useRoute()
  16. const title = computed(() => {
  17. return unref(header.value.title) || route.meta.title
  18. })
  19. const showHeader = computed(() => {
  20. return route.meta.hasHeader
  21. })
  22. const hasOwnLandmarks = computed(() => {
  23. return route.meta.hasOwnLandmarks
  24. })
  25. const mainContainer = computed(() => (hasOwnLandmarks.value ? 'div' : 'main'))
  26. const footerContainer = computed(() =>
  27. hasOwnLandmarks.value ? 'div' : 'footer',
  28. )
  29. useAuthenticationChanges()
  30. </script>
  31. <template>
  32. <div>
  33. <LayoutHeader
  34. v-if="showHeader"
  35. v-bind="header as HeaderProps"
  36. :title="title"
  37. />
  38. <component :is="mainContainer" data-test-id="appMain">
  39. <RouterView :key="testKey" />
  40. </component>
  41. <component :is="footerContainer" data-bottom-navigation />
  42. <DynamicInitializer name="dialog" />
  43. <CommonNotifications />
  44. <CommonImageViewer />
  45. <CommonConfirmation />
  46. </div>
  47. </template>