working on talents actualisation

This commit is contained in:
2023-09-03 23:43:29 +02:00
parent b78f79f59c
commit f382f96fee
4 changed files with 80 additions and 64 deletions

View File

@@ -11,7 +11,7 @@ export const useColorStore = defineStore(
appConfig.ui.primary = newColor
}, { immediate: true })
const setColor = (color: string) => {
function setColor(color: string) {
colorCookie.value = color as ColorsTheme
}

30
src/store/talents.ts Normal file
View File

@@ -0,0 +1,30 @@
import { defineStore } from 'pinia'
export const useTalentsStore = defineStore(
'talents',
() => {
const currentCategory = ref<string>('all')
const currentFavorite = ref<boolean>(false)
const getCategory = computed(() => currentCategory)
const isFavorite = computed(() => currentFavorite)
function setCategory(category: string) {
currentCategory.value = category
}
function setFavorite() {
currentFavorite.value = !currentFavorite.value
}
return {
getCategory,
setCategory,
setFavorite,
isFavorite,
}
},
{
persist: true,
}
)