Vitron-Front/app/components/ProfilePagesHeader.tsx
Arda Samadi 3156fb4204 Desktop: account area (shared sidebar) + brands list
- new profile.tsx layout: sticky desktop sidebar (user card + menu) wrapping all
  /profile/* pages; mobile renders page content only (unchanged)
- ProfilePagesHeader hidden at lg (one change covers all account sub-pages +
  cart); profile index shows a welcome on desktop (menu lives in the sidebar)
- sellers: 5-col brand grid with name overlay, contained, mobile header hidden
- MyLayout: desktop gate now covers /profile/* and /sellers
2026-06-16 12:46:22 +03:30

39 lines
1.1 KiB
TypeScript

import { ArrowRight } from "lucide-react";
import { memo, useCallback } from "react";
import { useNavigate } from "@remix-run/react";
import { safeGoBack } from "~/utils/helpers";
interface ProfilePagesHeaderProps {
title: string;
hideBackButton?: boolean;
rightContent?: React.ReactNode;
}
const ProfilePagesHeader = memo(function ProfilePagesHeader({
title,
hideBackButton,
rightContent,
}: ProfilePagesHeaderProps) {
const navigate = useNavigate();
const handleBack = useCallback(() => {
safeGoBack(navigate);
}, [navigate]);
return (
<div className="lg:hidden flex flex-row h-[65px] sticky top-0 z-30 bg-WHITE w-full items-center justify-center border-b border-inner-border">
{!hideBackButton && (
<ArrowRight
onClick={handleBack}
className="absolute top-5 right-5 cursor-pointer"
/>
)}
<p className="text-B16 font-bold">{title}</p>
{rightContent && (
<div className="absolute top-4 left-4">{rightContent}</div>
)}
</div>
);
});
export default ProfilePagesHeader;