This commit is contained in:
marzban-dev
2025-01-28 00:26:02 +03:30
parent bbf00fed42
commit c14946ddb0
+37 -36
View File
@@ -3,6 +3,7 @@
import useGetAccount from "~/composables/api/account/useGetAccount"; import useGetAccount from "~/composables/api/account/useGetAccount";
import { useAuth } from "~/composables/api/auth/useAuth"; import { useAuth } from "~/composables/api/auth/useAuth";
import useBaseUrl from "~/composables/global/useBaseUrl";
// types // types
@@ -15,6 +16,7 @@ type NavLink = {
const { data: account } = useGetAccount(); const { data: account } = useGetAccount();
const { logout } = useAuth(); const { logout } = useAuth();
const baseUrl = useBaseUrl();
const nav_links = ref<NavLink[]>([ const nav_links = ref<NavLink[]>([
{ {
@@ -45,45 +47,44 @@ const nav_links = ref<NavLink[]>([
<div <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]"
> >
<div <div class="flex items-center gap-16">
v-if="!!account" <div class="flex items-center justify-end gap-[1.5rem]">
class="w-2/12 flex items-center justify-start" <button
> v-if="!!account"
<span class="size-[2rem] bg-black rounded-full"></span> :title="account.first_name + ' ' + account.last_name"
<button @click="() => logout(true)">خروج از وبسایت</button> @click="() => logout(true)"
</div> class="size-[1.5rem] relative overflow-hidden rounded-full bg-slate-300"
>
<img :src="baseUrl + account.profile_photo" alt="" />
</button>
<NuxtLink to="/signin" v-else class="flex-center">
<Icon name="ci:profile" size="20px" class="**:stroke-black" />
</NuxtLink>
<button class="flex-center">
<Icon name="ci:search" size="18px" class="**:stroke-black" />
</button>
<button class="flex-center">
<Icon name="ci:cart" size="20px" class="**:stroke-black" />
</button>
</div>
<button <nav
@click="navigateTo('/signin')" class="flex-center gap-[2.5rem] typo-label-sm text-slate-600"
class="cursor-pointer"
v-else
>
وارد شوید
</button>
<nav
class="flex-center gap-[2.5rem] w-8/12 typo-label-sm text-slate-500"
>
<NuxtLink
v-for="(link, index) in nav_links"
:key="index"
:to="link.path"
> >
{{ link.title }} <NuxtLink
</NuxtLink> v-for="(link, index) in nav_links"
</nav> :key="index"
:to="link.path"
<div class="w-2/12 flex items-center justify-end gap-[1.5rem]"> >
<button class="size-[1.5rem] flex-center"> {{ link.title }}
<Icon name="ci:search" class="**:stroke-black" /> </NuxtLink>
</button> </nav>
<button class="size-[1.5rem] flex-center">
<Icon name="ci:profile" class="**:stroke-black" />
</button>
<button class="size-[1.5rem] flex-center">
<Icon name="ci:cart" class="**:stroke-black" />
</button>
</div> </div>
<div>
LOGO
</div>
</div> </div>
</header> </header>
</template> </template>