refactor: navbar - make user profile consistent with links.

This commit is contained in:
Kentai Radiquum 2024-07-16 05:43:46 +05:00
parent 35c79559ab
commit a3f5f2e116
Signed by: Radiquum
GPG key ID: 858E8EE696525EED

View file

@ -34,7 +34,7 @@ export const Navbar = () => {
title: "Закладки", title: "Закладки",
href: "/bookmarks", href: "/bookmarks",
withAuthOnly: true, withAuthOnly: true,
mobileMenu: true, mobileMenu: false,
}, },
{ {
id: 4, id: 4,
@ -66,7 +66,11 @@ export const Navbar = () => {
key={link.id} key={link.id}
href={link.href} href={link.href}
className={`flex-col items-center sm:flex-row ${ className={`flex-col items-center sm:flex-row ${
link.mobileMenu ? "hidden sm:flex" : "flex" link.withAuthOnly && !userStore.isAuth
? "hidden"
: link.mobileMenu
? "hidden sm:flex"
: "flex"
}`} }`}
> >
<span <span
@ -86,14 +90,18 @@ export const Navbar = () => {
})} })}
</nav> </nav>
{userStore.isAuth ? ( {userStore.isAuth ? (
<div className="flex items-center justify-center gap-2"> <div className="flex flex-col items-center justify-center gap-1 sm:flex-row">
<img src={userStore.user.avatar} alt="" className="w-8 h-8 rounded-full" /> <img
<p>{userStore.user.login}</p> src={userStore.user.avatar}
alt=""
className="w-6 h-6 rounded-full"
/>
<p className="text-xs sm:text-base">{userStore.user.login}</p>
</div> </div>
) : ( ) : (
<Link <Link
href="/login" href="/login"
className="flex flex-col items-center gap-1 justify-cen ter sm:flex-row" className="flex flex-col items-center justify-center gap-1 sm:flex-row"
> >
<span <span
className={`w-6 h-6 iconify ${ className={`w-6 h-6 iconify ${