control side menu
Gitea Actions / Deploy (push) Successful in 2m4s

This commit is contained in:
vadim committed 2026-11-05 09:39:27 +03:00
1 parent c96ef32fe9
commit ef880f0c6b
2 files changed
+18 -9

No files matched your search

+2 -6
View File
@@ -6,6 +6,7 @@ interface Props {
} }
const { isAuth } = defineProps<Props>() const { isAuth } = defineProps<Props>()
const open = defineModel<boolean>('open')
const menu = ref([ const menu = ref([
{ {
@@ -23,16 +24,11 @@ const menu = ref([
value: 3, value: 3,
props: { prependIcon: 'mdi-calendar', to: '/calendar', requiresAuth: true }, props: { prependIcon: 'mdi-calendar', to: '/calendar', requiresAuth: true },
}, },
// {
// title: 'Games',
// value: 4,
// props: { prependIcon: 'mdi-view-dashboard', to: '/games', requiresAuth: false },
// },
]) ])
</script> </script>
<template> <template>
<v-navigation-drawer rounded="0" width="200" persistent permanent class="pt-4"> <v-navigation-drawer v-model="open" rounded="0" width="200" persistent permanent class="pt-4">
<template v-for="item in menu" :key="item.value"> <template v-for="item in menu" :key="item.value">
<v-list-item <v-list-item
density="compact" density="compact"
+16 -3
View File
@@ -10,23 +10,34 @@ import NavigationMenu from '@/components/NavigationMenu.vue'
import { usePushNotifications } from '@/composables/usePushNotifications.ts' import { usePushNotifications } from '@/composables/usePushNotifications.ts'
import ProjectMenu from '@/components/ProjectMenu.vue' import ProjectMenu from '@/components/ProjectMenu.vue'
import NotificationsList from '@/components/NotificationsList.vue' import NotificationsList from '@/components/NotificationsList.vue'
import { useStorage } from '@vueuse/core'
const title = 'Ulitka'
const MENU_STATE_KEY = 'menuStateKey'
const router = useRouter() const router = useRouter()
const route = useRoute() const route = useRoute()
const session = authClient.useSession() const session = authClient.useSession()
const { mode: themeMode, cycleThemeMode } = useThemeMode() const { mode: themeMode, cycleThemeMode } = useThemeMode()
const push = usePushNotifications() const push = usePushNotifications()
const open = useStorage(MENU_STATE_KEY, true)
const title = 'Ulitka'
const isAuth = computed(() => !!session.value.data) const isAuth = computed(() => !!session.value.data)
const menuIcon = computed(() => {
return open.value ? 'mdi-menu-open' : 'mdi-menu-close'
})
/** Shown in the avatar until the user uploads a picture */ /** Shown in the avatar until the user uploads a picture */
const initial = computed(() => { const initial = computed(() => {
const user = session.value.data?.user const user = session.value.data?.user
return (user?.name.trim() || user?.email || '?').charAt(0).toUpperCase() return (user?.name.trim() || user?.email || '?').charAt(0).toUpperCase()
}) })
function changeMenuState() {
open.value = !open.value
}
function goToSignIn() { function goToSignIn() {
router.push({ path: '/sign-in' }) router.push({ path: '/sign-in' })
} }
@@ -63,6 +74,8 @@ const fluid = computed(() => {
<template> <template>
<v-layout> <v-layout>
<v-app-bar density="compact" elevation="0" border rounded="0"> <v-app-bar density="compact" elevation="0" border rounded="0">
<v-btn rounded="0" :icon="menuIcon" @click="changeMenuState" />
<v-app-bar-title class="d-flex"> <v-app-bar-title class="d-flex">
<router-link class="text-decoration-none text-link font-weight-bold d-flex align-baseline ga-2" to="/"> <router-link class="text-decoration-none text-link font-weight-bold d-flex align-baseline ga-2" to="/">
<v-icon icon="mdi-snail" /> <v-icon icon="mdi-snail" />
@@ -117,7 +130,7 @@ const fluid = computed(() => {
</div> </div>
</v-app-bar> </v-app-bar>
<navigation-menu :is-auth="isAuth" /> <navigation-menu v-model:open="open" :is-auth="isAuth" />
<v-main> <v-main>
<v-container :fluid="fluid" class="layout-container"> <v-container :fluid="fluid" class="layout-container">