2022-04-15 14:24:30 +00:00
|
|
|
<template>
|
|
|
|
<section>
|
|
|
|
<h1>Theme</h1>
|
|
|
|
<ul class="themes">
|
2022-05-09 10:36:57 +00:00
|
|
|
<li v-for="theme in themes" :key="theme.id" data-testid="theme-card">
|
2022-04-21 22:51:48 +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>
|
2022-07-07 18:05:46 +00:00
|
|
|
import { toRef } from 'vue'
|
2022-04-15 14:24:30 +00:00
|
|
|
import { themeStore } from '@/stores'
|
|
|
|
|
2022-07-07 18:05:46 +00:00
|
|
|
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>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.themes {
|
|
|
|
display: grid;
|
|
|
|
grid-auto-rows: 8rem;
|
|
|
|
grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
|
|
|
|
grid-gap: .75rem 1rem;
|
|
|
|
|
|
|
|
@media only screen and (max-width: 667px) {
|
|
|
|
grid-template-columns: 1fr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|