koel/resources/assets/js/components/profile-preferences/ThemeList.vue

38 lines
863 B
Vue
Raw Normal View History

2022-04-15 14:24:30 +00:00
<template>
<section>
<ul class="themes">
<li v-for="theme in themes" :key="theme.id" data-testid="theme-card">
2022-12-02 16:17:37 +00:00
<ThemeCard :key="theme.id" :theme="theme" @selected="setTheme" />
2022-04-15 14:24:30 +00:00
</li>
</ul>
</section>
</template>
2022-04-15 17:00:08 +00:00
<script lang="ts" setup>
import { toRef } from 'vue'
2022-04-15 14:24:30 +00:00
import { themeStore } from '@/stores'
import ThemeCard from '@/components/profile-preferences/ThemeCard.vue'
2022-04-21 22:51:48 +00:00
const themes = toRef(themeStore.state, 'themes')
2022-04-15 14:24:30 +00:00
2022-04-15 17:00:08 +00:00
const setTheme = (theme: Theme) => themeStore.setTheme(theme)
2022-04-15 14:24:30 +00:00
</script>
2024-04-04 20:13:35 +00:00
<style lang="postcss" scoped>
2022-04-15 14:24:30 +00:00
.themes {
display: grid;
grid-auto-rows: 8rem;
2024-04-03 14:48:52 +00:00
grid-template-columns: auto auto auto;
2022-04-15 14:24:30 +00:00
grid-gap: .75rem 1rem;
2024-04-03 14:48:52 +00:00
@media only screen and (max-width: 768px) {
grid-template-columns: auto auto;
}
@media only screen and (max-width: 480px) {
grid-template-columns: auto;
2022-04-15 14:24:30 +00:00
}
}
</style>