fix: user info
This commit is contained in:
@@ -24,11 +24,12 @@
|
||||
<template #footer>
|
||||
<UDropdownMenu :items="userItems" :content="{ align: 'center', collisionPadding: 12 }"
|
||||
:ui="{ content: 'w-(--reka-dropdown-menu-trigger-width) min-w-48' }">
|
||||
<UButton v-bind="user" :label="user?.name" trailing-icon="i-lucide-chevrons-up-down" color="neutral"
|
||||
<UButton v-bind="userStore.user" :label="userStore.user?.email" trailing-icon="i-lucide-chevrons-up-down" color="neutral"
|
||||
variant="ghost" square class="w-full data-[state=open]:bg-elevated overflow-hidden" :ui="{
|
||||
trailingIcon: 'text-dimmed ms-auto'
|
||||
}" />
|
||||
</UDropdownMenu>
|
||||
<!-- first_name: '', last_name: '' -->
|
||||
</template>
|
||||
</USidebar>
|
||||
|
||||
@@ -63,10 +64,14 @@ import { ref, computed, onMounted } from 'vue'
|
||||
import { useColorMode } from '@vueuse/core'
|
||||
import type { DropdownMenuItem, NavigationMenuItem } from '@nuxt/ui'
|
||||
import { defineShortcuts, extractShortcuts } from '@nuxt/ui/runtime/composables/defineShortcuts.js'
|
||||
import { LabelTrans, TopMenuItem } from '@/types'
|
||||
import { useAuthStore } from '../stores/customer/auth'
|
||||
|
||||
const authStore = useAuthStore()
|
||||
const userStore = useUserStore()
|
||||
|
||||
await userStore.getUser()
|
||||
|
||||
const open = ref(true)
|
||||
const authStore = useAuthStore()
|
||||
const colorMode = useColorMode()
|
||||
|
||||
const teams = ref([
|
||||
@@ -156,10 +161,11 @@ function getItems(state: 'collapsed' | 'expanded') {
|
||||
import { useRouter } from 'vue-router'
|
||||
import { currentLang } from '@/router/langs'
|
||||
import { useFetchJson } from '@/composable/useFetchJson'
|
||||
import { useAuthStore } from '@/stores/user/auth'
|
||||
import CountryCurrencySwitch from '@/components/inner/CountryCurrencySwitch.vue'
|
||||
import LangSwitch from '@/components/inner/LangSwitch.vue'
|
||||
import ThemeSwitch from '@/components/inner/ThemeSwitch.vue'
|
||||
import type { LabelTrans, TopMenuItem } from '@/types'
|
||||
import { useUserStore } from '@/stores/user'
|
||||
|
||||
|
||||
const router = useRouter()
|
||||
@@ -217,13 +223,6 @@ function transformMenu(
|
||||
})
|
||||
}
|
||||
|
||||
const user = ref({
|
||||
name: 'Benjamin Canac',
|
||||
avatar: {
|
||||
src: 'https://github.com/benjamincanac.png',
|
||||
alt: 'Benjamin Canac'
|
||||
}
|
||||
})
|
||||
|
||||
const userItems = computed<DropdownMenuItem[][]>(() => [
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user