feat(settings): add sidebar visibility state to settings store
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { sluggy } from '#imports';
|
||||
import { sluggy, useSettingsStore } from '#imports';
|
||||
import { useHuntStore } from '~/stores/hunt';
|
||||
import { useTitleStore } from '~/stores/title';
|
||||
|
||||
@@ -11,7 +11,8 @@ const breakpoints = useBreakpoint();
|
||||
const titleStore = useTitleStore();
|
||||
const huntStore = useHuntStore();
|
||||
|
||||
const isSidebarVisible = ref(breakpoints.mdUp);
|
||||
const settingsStore = useSettingsStore();
|
||||
const { isSidebarVisible } = storeToRefs(settingsStore);
|
||||
|
||||
const slugs = computed(() => checkSlug(route.params));
|
||||
|
||||
@@ -50,7 +51,7 @@ const isHuntAdmin = computed(
|
||||
</template>
|
||||
|
||||
<template #left>
|
||||
<VaSidebar v-model="isSidebarVisible">
|
||||
<VaSidebar v-model="isSidebarVisible" :hoverable="breakpoints.mdUp">
|
||||
<VaSidebarItem
|
||||
:to="localePath('/')"
|
||||
:active="localePath('/') === route.path"
|
||||
|
||||
@@ -2,8 +2,9 @@ export const useSettingsStore = defineStore(
|
||||
'picSettings',
|
||||
() => {
|
||||
const hideAnswers = ref(true);
|
||||
const isSidebarVisible = ref(false);
|
||||
|
||||
return { hideAnswers };
|
||||
return { hideAnswers, isSidebarVisible };
|
||||
},
|
||||
{ persist: true }
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user