feat: use type for screen header layout

This commit is contained in:
Phan An 2022-07-17 11:07:46 +02:00
parent 47dc2a5744
commit 5ecfc89aa6
No known key found for this signature in database
GPG key ID: A81E4477F0BB6FDC
3 changed files with 3 additions and 2 deletions

View file

@ -20,7 +20,7 @@
</template>
<script lang="ts" setup>
const props = withDefaults(defineProps<{ layout?: 'expanded' | 'collapsed' }>(), { layout: 'expanded' })
const props = withDefaults(defineProps<{ layout?: ScreenHeaderLayout }>(), { layout: 'expanded' })
</script>
<style lang="scss">

View file

@ -29,7 +29,7 @@ export const useSongList = (
const isPhone = isMobile.phone
const selectedSongs = ref<Song[]>([])
const showingControls = ref(false)
const headerLayout = ref<'expanded' | 'collapsed'>('expanded')
const headerLayout = ref<ScreenHeaderLayout>('expanded')
const onScrollBreakpoint = (direction: 'up' | 'down') => {
headerLayout.value = direction === 'down' ? 'collapsed' : 'expanded'

View file

@ -116,6 +116,7 @@ interface FileSystemEntry {
}
type MediaInfoDisplayMode = 'aside' | 'full'
type ScreenHeaderLayout = 'expanded' | 'collapsed'
interface AlbumTrack {
readonly title: string