chore: format project automatically before starting dev server
This commit is contained in:
+48
-23
@@ -44,24 +44,23 @@ export default function Header() {
|
||||
return () => window.removeEventListener('scroll', onScroll);
|
||||
}, []);
|
||||
|
||||
console.log(
|
||||
"%c👋 Hamed Abdollahzade · Frontend Developer",
|
||||
"font-size:14px;font-weight:600;"
|
||||
);
|
||||
console.log('%c👋 Hamed Abdollahzade · Frontend Developer', 'font-size:14px;font-weight:600;');
|
||||
|
||||
return (
|
||||
<header
|
||||
className={`fixed top-0 inset-x-0 z-50 transition-all duration-300 ${
|
||||
scrolled || pathname !== '/' ? 'bg-page-85 backdrop-blur-md shadow-[0_1px_0_0_rgba(0,166,147,0.25)]' : 'bg-transparent'
|
||||
scrolled || pathname !== '/'
|
||||
? 'bg-page-85 backdrop-blur-md shadow-[0_1px_0_0_rgba(0,166,147,0.25)]'
|
||||
: 'bg-transparent'
|
||||
}`}
|
||||
>
|
||||
<div className="mx-auto max-w-7xl px-5 md:px-8 h-20 flex items-center justify-between gap-4">
|
||||
<Link href="/#hero" onClick={() => setMobileOpen(false)} className="flex items-center gap-2 shrink-0">
|
||||
<Image src="/images/icons/logo.png" alt="روبات مارکت" width={150} height={42} priority/>
|
||||
<Image src="/images/icons/logo.png" alt="روبات مارکت" width={150} height={42} priority />
|
||||
</Link>
|
||||
|
||||
<nav className="hidden xl:flex items-center gap-5 2xl:gap-7">
|
||||
{navLinks.map((link) => (
|
||||
{navLinks.map(link => (
|
||||
<Link
|
||||
key={link.href}
|
||||
href={link.href}
|
||||
@@ -74,37 +73,47 @@ export default function Header() {
|
||||
|
||||
<div className="flex items-center gap-2 md:gap-3">
|
||||
<div className="hidden md:flex items-center gap-2">
|
||||
<LanguageToggle/>
|
||||
<ThemeToggle/>
|
||||
<LanguageToggle />
|
||||
<ThemeToggle />
|
||||
</div>
|
||||
|
||||
{auth.isAuthenticated ? (
|
||||
<Button className="hidden sm:inline-flex" icon={<UserOutlined/>} href="/dashboard">{accountLabel}</Button>
|
||||
<Button className="hidden sm:inline-flex" icon={<UserOutlined />} href="/dashboard">
|
||||
{accountLabel}
|
||||
</Button>
|
||||
) : (
|
||||
<Button className="hidden sm:inline-flex" icon={<UserOutlined/>} onClick={() => auth.openLogin()}>{account.login}</Button>
|
||||
<Button
|
||||
className="hidden sm:inline-flex"
|
||||
icon={<UserOutlined />}
|
||||
onClick={() => auth.openLogin()}
|
||||
>
|
||||
{account.login}
|
||||
</Button>
|
||||
)}
|
||||
|
||||
<Badge count={cartCount} size="small" offset={[-2, 2]}>
|
||||
<ProtectedLink href="/cart" onClick={() => setMobileOpen(false)}
|
||||
className="w-11 h-11 rounded-full border border-subtle bg-elevated inline-flex items-center justify-center text-xl text-primary hover:text-brand-400">
|
||||
<ShoppingCartOutlined/>
|
||||
<ProtectedLink
|
||||
href="/cart"
|
||||
onClick={() => setMobileOpen(false)}
|
||||
className="w-11 h-11 rounded-full border border-subtle bg-elevated inline-flex items-center justify-center text-xl text-primary hover:text-brand-400"
|
||||
>
|
||||
<ShoppingCartOutlined />
|
||||
</ProtectedLink>
|
||||
</Badge>
|
||||
|
||||
<button
|
||||
className="xl:hidden text-brand-400 text-2xl"
|
||||
onClick={() => setMobileOpen((v) => !v)}
|
||||
onClick={() => setMobileOpen(v => !v)}
|
||||
aria-label="menu"
|
||||
>
|
||||
{mobileOpen ? <CloseOutlined/> : <MenuOutlined/>}
|
||||
{mobileOpen ? <CloseOutlined /> : <MenuOutlined />}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{mobileOpen && (
|
||||
<nav
|
||||
className="xl:hidden bg-elevated-95 backdrop-blur-md border-t border-subtle px-5 py-4 flex flex-col gap-4 max-h-[calc(100vh-5rem)] overflow-y-auto">
|
||||
{navLinks.map((link) => (
|
||||
<nav className="xl:hidden bg-elevated-95 backdrop-blur-md border-t border-subtle px-5 py-4 flex flex-col gap-4 max-h-[calc(100vh-5rem)] overflow-y-auto">
|
||||
{navLinks.map(link => (
|
||||
<Link
|
||||
key={link.href}
|
||||
href={link.href}
|
||||
@@ -115,12 +124,28 @@ export default function Header() {
|
||||
</Link>
|
||||
))}
|
||||
<div className="flex items-center gap-3 pt-2 border-t border-subtle">
|
||||
<LanguageToggle/>
|
||||
<ThemeToggle/>
|
||||
<LanguageToggle />
|
||||
<ThemeToggle />
|
||||
{auth.isAuthenticated ? (
|
||||
<Button icon={<UserOutlined/>} className="flex-1" href="/dashboard" onClick={() => setMobileOpen(false)}>{accountLabel}</Button>
|
||||
<Button
|
||||
icon={<UserOutlined />}
|
||||
className="flex-1"
|
||||
href="/dashboard"
|
||||
onClick={() => setMobileOpen(false)}
|
||||
>
|
||||
{accountLabel}
|
||||
</Button>
|
||||
) : (
|
||||
<Button icon={<UserOutlined/>} className="flex-1" onClick={() => {setMobileOpen(false); auth.openLogin();}}>{account.login}</Button>
|
||||
<Button
|
||||
icon={<UserOutlined />}
|
||||
className="flex-1"
|
||||
onClick={() => {
|
||||
setMobileOpen(false);
|
||||
auth.openLogin();
|
||||
}}
|
||||
>
|
||||
{account.login}
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
Reference in New Issue
Block a user