diff --git a/app/components/desktop/DesktopHeader.tsx b/app/components/desktop/DesktopHeader.tsx index c59a48d..3045309 100644 --- a/app/components/desktop/DesktopHeader.tsx +++ b/app/components/desktop/DesktopHeader.tsx @@ -3,6 +3,7 @@ import { useState, type FormEvent } from "react"; import { Search, Heart, ShoppingBag, User } from "lucide-react"; import { useRootData } from "~/hooks/use-root-data"; import { useCartCount } from "~/requestHandler/use-cart-hooks"; +import { SunMoonToggle } from "~/components/SunMoonToggle"; import logo from "~/assets/logo/SVG-07.svg"; const NAV = [ @@ -19,9 +20,10 @@ const NAV = [ const DesktopHeader = () => { const location = useLocation(); const navigate = useNavigate(); - const { user } = useRootData(); + const { user, theme } = useRootData(); const cartCount = useCartCount(); const [q, setQ] = useState(""); + const isLoggedIn = !!user?.access_token; const isActive = (to: string) => to === "/" ? location.pathname === "/" : location.pathname.startsWith(to); @@ -74,38 +76,51 @@ const DesktopHeader = () => { /> -
- - - - - {cartCount > 0 && user?.access_token ? ( - - {cartCount} - - ) : null} - - - - - - - +
+ + {isLoggedIn ? ( + <> + + + + + {cartCount > 0 ? ( + + {cartCount} + + ) : null} + + + + + + + + + ) : ( + + ورود / ثبت نام + + )}
diff --git a/app/routes/profile.about.tsx b/app/routes/profile.about.tsx index 135dcd1..a00838b 100644 --- a/app/routes/profile.about.tsx +++ b/app/routes/profile.about.tsx @@ -47,12 +47,14 @@ export default function AboutPage() { return (
- {/* Header */} - safeGoBack(navigate)} - /> + {/* Header (mobile) */} +
+ safeGoBack(navigate)} + /> +
{/* Content */}
{/* Logo Section */} diff --git a/app/routes/profile.faq.tsx b/app/routes/profile.faq.tsx index d4fab93..8af14d1 100644 --- a/app/routes/profile.faq.tsx +++ b/app/routes/profile.faq.tsx @@ -135,11 +135,13 @@ export default function FAQ() { return (
- safeGoBack(navigate)} - /> +
+ safeGoBack(navigate)} + /> +

سوالات متداول