Frontend: added class to userOption

main
TZGyn 2 years ago
parent 2317dbfded
commit 7991f4fe4b
Signed by: TZGyn
GPG Key ID: 122EAF77AE81FD4A

@ -8,6 +8,7 @@ const openSetting = ref<Boolean>(false)
type UserOption = { type UserOption = {
title: string title: string
icon?: string icon?: string
class?: string
onClick: () => void onClick: () => void
} }
@ -19,19 +20,20 @@ const userOptions: Array<UserOption> = [
openUrl('https://github.com/TZGyn') openUrl('https://github.com/TZGyn')
}, },
}, },
{
title: 'Profile',
icon: 'user',
onClick: () => openUserProfile(),
},
{ {
title: 'Log Out', title: 'Log Out',
icon: 'mdi:logout', icon: 'mdi:logout',
class: 'hover:text-red-500',
onClick: async () => { onClick: async () => {
await userLogout() await userLogout()
useRouter().push('/login') useRouter().push('/login')
}, },
}, },
{
title: 'Profile',
icon: 'user',
onClick: () => openUserProfile(),
},
] ]
onClickOutside(sidebar, () => { onClickOutside(sidebar, () => {
@ -72,6 +74,7 @@ onClickOutside(sidebar, () => {
<div <div
v-for="userOption in userOptions" v-for="userOption in userOptions"
class="flex w-full items-center p-4 text-xl hover:cursor-pointer hover:bg-lightgray" class="flex w-full items-center p-4 text-xl hover:cursor-pointer hover:bg-lightgray"
:class="userOption.class"
@click="userOption.onClick()"> @click="userOption.onClick()">
<Icon <Icon
v-if="userOption.icon" v-if="userOption.icon"

Loading…
Cancel
Save