removed user dropdown

This commit is contained in:
Mamalizz
2025-02-06 22:56:39 +03:30
parent f3bb6c3480
commit cc91170dca
+17 -51
View File
@@ -3,41 +3,13 @@
import useGetAccount from "~/composables/api/account/useGetAccount";
import { useAuth } from "~/composables/api/auth/useAuth";
import { useToast } from "~/composables/global/useToast";
import { NAV_LINKS } from "~/constants";
// state
const route = useRoute();
const router = useRouter();
const { addToast } = useToast();
const { logout, token } = useAuth();
const profileDropdownItems = ref<DropdownItem[]>([
{
title: "ورود به پنل کاربری",
icon: "ci:profile",
onClick: () => router.push({ name: "profile" }),
},
{
title: "خروج از حساب",
icon: "bi:arrow-bar-left",
itemClass: "!text-red-500",
iconClass: "**:stroke-red-500 **:fill-transparent",
onClick: () => {
logout();
nextTick(() => {
addToast({
message: "با موفقیت از حساب خارج شدید",
options: {
status: "success",
},
});
});
},
},
]);
const { token } = useAuth();
// queries
@@ -55,32 +27,26 @@ const isHomePage = computed(() => route.path === "/");
:class="isHomePage ? 'fixed top-0 left-0 z-999' : 'z-999'"
>
<div
class="size-full flex items-center justify-between container py-[2.25rem]"
class="size-full flex items-center justify-between container py-[2.25rem] shrink-0 grow-0"
>
<div class="flex items-center gap-16">
<div class="flex items-center justify-end gap-[1.5rem]">
<Tooltip v-if="!!account && !!token" title="حساب کاربری">
<Dropdown :items="profileDropdownItems">
<template #trigger>
<button
class="size-[1.6rem] flex items-center justify-center relative overflow-hidden rounded-full border border-black"
>
<Avatar
:src="account.profile_photo"
:alt="
account.first_name &&
account.last_name
? `${account.first_name.charAt(
0
)} ${account.last_name.charAt(
0
)}`
: ''
"
/>
</button>
</template>
</Dropdown>
<NuxtLink
:to="{ name: 'profile' }"
class="size-[1.6rem] flex items-center justify-center relative overflow-hidden rounded-full border-[1.2px] border-black"
>
<Avatar
:src="account.profile_photo"
:alt="
account.first_name && account.last_name
? `${account.first_name.charAt(
0
)} ${account.last_name.charAt(0)}`
: ''
"
/>
</NuxtLink>
</Tooltip>
<Tooltip v-else title="ورود">
<NuxtLink to="/signin" class="flex-center">