Skip to content
Snippets Groups Projects
App.vue 1.09 KiB
Newer Older
  • Learn to ignore specific revisions
  •   <div :key="locale" class="tw-flex tw-flex-col tw-min-h-screen">
    
        <AppNavbar :modules="modules" />
    
        <div class="tw-flex-1 tw-flex tw-my-8">
    
          <RouterView v-if="authStore.steeringUser" />
          <Home v-else :modules="modules" />
    
    Konrad Mohrfeldt's avatar
    Konrad Mohrfeldt committed
        </div>
    
        <AppFooter />
    
    Konrad Mohrfeldt's avatar
    Konrad Mohrfeldt committed
      </div>
    
    <script lang="ts" setup>
    
    import AppNavbar from './components/Navbar.vue'
    
    import AppFooter from './components/Footer.vue'
    
    Konrad Mohrfeldt's avatar
    Konrad Mohrfeldt committed
    import Home from './Pages/Home.vue'
    
    import { useI18n } from '@/i18n'
    
    import { useAuthStore } from '@/stores/auth'
    
    import { computedIter } from '@/util'
    
    const { locale, t } = useI18n()
    
    const authStore = useAuthStore()
    
    const modules = computedIter(function* () {
    
      if (authStore.currentUser) {
    
        yield {
          icon: '/assets/shows.svg',
          slug: 'shows',
          title: t('navigation.shows'),
    
        yield {
          icon: '/assets/files.svg',
          slug: 'files',
          title: t('navigation.filesPlaylists'),
        }
      }
    
      if (authStore.isSuperuser) {
    
        yield {
          icon: '/assets/calendar.svg',
          slug: 'calendar',
          title: t('navigation.calendar'),