Skip to content
Snippets Groups Projects
Commit 5256c765 authored by Konrad Mohrfeldt's avatar Konrad Mohrfeldt :koala:
Browse files

refactor: refactor section wrapper into separate component

parent aa707763
No related branches found
No related tags found
No related merge requests found
Pipeline #3497 passed
<template>
<section>
<header class="tw-relative tw-w-fit tw-flex tw-items-center tw-gap-6 tw-mt-12 tw-mb-4">
<SectionTitle>{{ title }}</SectionTitle>
<slot name="header" />
</header>
<slot />
</section>
</template>
<script lang="ts" setup>
import SectionTitle from '@/components/generic/SectionTitle.vue'
defineOptions({ compatConfig: { MODE: 3 } })
defineProps<{
title: string
}>()
</script>
<template> <template>
<section> <ASection :title="t('showSchedules.title')">
<header class="tw-flex tw-items-center tw-gap-6 tw-mt-12 tw-mb-4"> <template #header>
<SectionTitle>{{ t('showSchedules.title') }}</SectionTitle>
<button <button
v-if="collapseSchedules" v-if="collapseSchedules"
type="button" type="button"
...@@ -13,7 +11,7 @@ ...@@ -13,7 +11,7 @@
> >
{{ t(isCollapsed ? 'showSchedules.showAll' : 'showSchedules.hide') }} {{ t(isCollapsed ? 'showSchedules.showAll' : 'showSchedules.hide') }}
</button> </button>
</header> </template>
<Collapse <Collapse
id="schedule-collapsable" id="schedule-collapsable"
...@@ -86,7 +84,7 @@ ...@@ -86,7 +84,7 @@
</table> </table>
</div> </div>
</Collapse> </Collapse>
</section> </ASection>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
...@@ -98,9 +96,9 @@ import { useRRule } from '@/mixins/rrules' ...@@ -98,9 +96,9 @@ import { useRRule } from '@/mixins/rrules'
import { usePretty } from '@/mixins/prettyDate' import { usePretty } from '@/mixins/prettyDate'
import { lowercaseFirst, uppercaseFirst, useSelectedShow } from '@/utilities' import { lowercaseFirst, uppercaseFirst, useSelectedShow } from '@/utilities'
import { useI18n } from '@/i18n' import { useI18n } from '@/i18n'
import SectionTitle from '@/components/generic/SectionTitle.vue'
import Collapse from '@/components/generic/Collapse.vue'
import { Schedule } from '@/types' import { Schedule } from '@/types'
import Collapse from '@/components/generic/Collapse.vue'
import ASection from '@/components/generic/ASection.vue'
defineOptions({ defineOptions({
compatConfig: { MODE: 3 }, compatConfig: { MODE: 3 },
......
<template> <template>
<section> <ASection :title="t('showTimeslots.title')">
<header class="tw-flex tw-items-center tw-gap-6 tw-mt-12 tw-mb-4"> <template #header>
<SectionTitle>{{ t('showTimeslots.title') }}</SectionTitle>
<Popover class="tw-relative"> <Popover class="tw-relative">
<!-- TODO: this span is on purpose because headless ui seems to interfere with vue compat --> <!-- TODO: this span is on purpose because headless ui seems to interfere with vue compat -->
<PopoverButton as="span"> <PopoverButton as="span">
...@@ -18,7 +17,7 @@ ...@@ -18,7 +17,7 @@
<TimeSlotFilter v-model="page" class="tw-flex-col" @paginate="paginationData = $event" /> <TimeSlotFilter v-model="page" class="tw-flex-col" @paginate="paginationData = $event" />
</PopoverPanel> </PopoverPanel>
</Popover> </Popover>
</header> </template>
<div class="aura-table-wrapper"> <div class="aura-table-wrapper">
<table ref="tableEl" class="aura-table"> <table ref="tableEl" class="aura-table">
...@@ -61,7 +60,7 @@ ...@@ -61,7 +60,7 @@
/> />
</div> </div>
</div> </div>
</section> </ASection>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
...@@ -74,7 +73,7 @@ import TimeSlotRow from '@/components/shows/TimeSlotRow.vue' ...@@ -74,7 +73,7 @@ import TimeSlotRow from '@/components/shows/TimeSlotRow.vue'
import { PaginationData } from '@/types' import { PaginationData } from '@/types'
import Pagination from '@/components/generic/Pagination.vue' import Pagination from '@/components/generic/Pagination.vue'
import PaginationRange from '@/components/generic/PaginationRange.vue' import PaginationRange from '@/components/generic/PaginationRange.vue'
import SectionTitle from '@/components/generic/SectionTitle.vue' import ASection from '@/components/generic/ASection.vue'
defineOptions({ defineOptions({
compatConfig: { MODE: 3 }, compatConfig: { MODE: 3 },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment