|
|
@ -22,14 +22,26 @@ type PageHeaderProps = { |
|
|
*/ |
|
|
*/ |
|
|
enableProfileQuery?: boolean; |
|
|
enableProfileQuery?: boolean; |
|
|
profile?: any; |
|
|
profile?: any; |
|
|
|
|
|
/** |
|
|
|
|
|
* Whether the header is sticky at the top during scroll (matching Flutter AppBar). |
|
|
|
|
|
* Defaults to true. |
|
|
|
|
|
*/ |
|
|
|
|
|
sticky?: boolean; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Standard AppBar for Marriage WebApp matching Flutter's Scaffold.appBar: |
|
|
|
|
|
* - Toolbar Height: 56px (Flutter Material kToolbarHeight) |
|
|
|
|
|
* - Top Safe Area: max(12px, var(--safe-top) + 4px) |
|
|
|
|
|
* - Sticky at top during body scroll with frosted blur backdrop |
|
|
|
|
|
*/ |
|
|
export function PageHeader({ |
|
|
export function PageHeader({ |
|
|
className, |
|
|
className, |
|
|
leftButton, |
|
|
leftButton, |
|
|
rightButton, |
|
|
rightButton, |
|
|
enableProfileQuery = true, |
|
|
enableProfileQuery = true, |
|
|
profile: profileProp, |
|
|
profile: profileProp, |
|
|
|
|
|
sticky = true, |
|
|
}: PageHeaderProps) { |
|
|
}: PageHeaderProps) { |
|
|
const { dictionary: t } = useI18n(); |
|
|
const { dictionary: t } = useI18n(); |
|
|
|
|
|
|
|
|
@ -57,51 +69,61 @@ export function PageHeader({ |
|
|
|
|
|
|
|
|
return ( |
|
|
return ( |
|
|
<header |
|
|
<header |
|
|
className={["flex items-center justify-between pb-3", className] |
|
|
|
|
|
|
|
|
style={{ |
|
|
|
|
|
paddingTop: "max(12px, calc(var(--safe-top) + 4px))", |
|
|
|
|
|
}} |
|
|
|
|
|
className={[ |
|
|
|
|
|
sticky |
|
|
|
|
|
? "sticky top-0 z-30 -mx-[17px] px-[17px] bg-[#F7F1F0]/90 backdrop-blur-md" |
|
|
|
|
|
: "relative z-30 -mx-[17px] px-[17px]", |
|
|
|
|
|
className, |
|
|
|
|
|
] |
|
|
.filter(Boolean) |
|
|
.filter(Boolean) |
|
|
.join(" ")} |
|
|
.join(" ")} |
|
|
> |
|
|
> |
|
|
{leftButton?.className?.includes("hidden") ? ( |
|
|
|
|
|
<div className="size-10 shrink-0" /> |
|
|
|
|
|
) : ( |
|
|
|
|
|
<NavigationButton icon="back" profile={profile} {...leftButton} /> |
|
|
|
|
|
)} |
|
|
|
|
|
<h1 className="font-faminela text-[20px] font-normal text-foreground"> |
|
|
|
|
|
{t["Habib Marriage"]} |
|
|
|
|
|
</h1> |
|
|
|
|
|
|
|
|
<div className="flex h-[56px] items-center justify-between"> |
|
|
|
|
|
{leftButton?.className?.includes("hidden") ? ( |
|
|
|
|
|
<div className="size-10 shrink-0" /> |
|
|
|
|
|
) : ( |
|
|
|
|
|
<NavigationButton icon="back" profile={profile} {...leftButton} /> |
|
|
|
|
|
)} |
|
|
|
|
|
|
|
|
{isCustomRightButton ? ( |
|
|
|
|
|
<NavigationButton |
|
|
|
|
|
icon={iconFromProp || "support"} |
|
|
|
|
|
profile={profile} |
|
|
|
|
|
{...(iconFromProp === "support" ? { iconLabel: t["Support"] } : {})} |
|
|
|
|
|
{...rightButtonRest} |
|
|
|
|
|
/> |
|
|
|
|
|
) : isMale ? ( |
|
|
|
|
|
<div className="flex items-center gap-2"> |
|
|
|
|
|
|
|
|
<h1 className="font-faminela text-[20px] font-normal text-[#171717] leading-none select-none"> |
|
|
|
|
|
{t["Habib Marriage"]} |
|
|
|
|
|
</h1> |
|
|
|
|
|
|
|
|
|
|
|
{isCustomRightButton ? ( |
|
|
<NavigationButton |
|
|
<NavigationButton |
|
|
icon="subscription" |
|
|
|
|
|
|
|
|
icon={iconFromProp || "support"} |
|
|
profile={profile} |
|
|
profile={profile} |
|
|
iconLabel={t["Subscription Status"] || "Subscription"} |
|
|
|
|
|
|
|
|
{...(iconFromProp === "support" ? { iconLabel: t["Support"] } : {})} |
|
|
|
|
|
{...rightButtonRest} |
|
|
/> |
|
|
/> |
|
|
|
|
|
) : isMale ? ( |
|
|
|
|
|
<div className="flex items-center gap-2"> |
|
|
|
|
|
<NavigationButton |
|
|
|
|
|
icon="subscription" |
|
|
|
|
|
profile={profile} |
|
|
|
|
|
iconLabel={t["Subscription Status"] || "Subscription"} |
|
|
|
|
|
/> |
|
|
|
|
|
<NavigationButton |
|
|
|
|
|
icon="support" |
|
|
|
|
|
profile={profile} |
|
|
|
|
|
iconLabel={t["Support"]} |
|
|
|
|
|
{...rightButtonRest} |
|
|
|
|
|
/> |
|
|
|
|
|
</div> |
|
|
|
|
|
) : ( |
|
|
<NavigationButton |
|
|
<NavigationButton |
|
|
icon="support" |
|
|
icon="support" |
|
|
profile={profile} |
|
|
profile={profile} |
|
|
iconLabel={t["Support"]} |
|
|
iconLabel={t["Support"]} |
|
|
{...rightButtonRest} |
|
|
{...rightButtonRest} |
|
|
/> |
|
|
/> |
|
|
</div> |
|
|
|
|
|
) : ( |
|
|
|
|
|
<NavigationButton |
|
|
|
|
|
icon="support" |
|
|
|
|
|
profile={profile} |
|
|
|
|
|
iconLabel={t["Support"]} |
|
|
|
|
|
{...rightButtonRest} |
|
|
|
|
|
/> |
|
|
|
|
|
)} |
|
|
|
|
|
|
|
|
)} |
|
|
|
|
|
</div> |
|
|
</header> |
|
|
</header> |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
export default PageHeader; |
|
|
export default PageHeader; |
|
|
|
|
|
|