Browse Source

refactor: fix layout scrolling behavior by enabling sticky headers and adjusting section min-heights

master
mortezaei 2 weeks ago
parent
commit
c332ec235d
  1. 4
      src/app/globals.css
  2. 4
      src/app/marriage-advisors/page.tsx
  3. 12
      src/app/new-match/profile/page.tsx

4
src/app/globals.css

@ -342,13 +342,11 @@ body.section-overlay-open .app-shell {
height: 100%; height: 100%;
height: 100dvh; height: 100dvh;
z-index: 50; z-index: 50;
overflow-x: hidden;
overflow-y: auto;
overflow: hidden;
overscroll-behavior: none; overscroll-behavior: none;
touch-action: pan-y; touch-action: pan-y;
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
padding-inline: 17px; padding-inline: 17px;
padding-bottom: var(--safe-bottom, 0px);
box-sizing: border-box; box-sizing: border-box;
background-color: var(--background); background-color: var(--background);
background-image: var(--default-page-background-image); background-image: var(--default-page-background-image);

4
src/app/marriage-advisors/page.tsx

@ -50,7 +50,7 @@ export default function MarriageAdvisorsPage({
className="-mx-[17px] flex h-dvh flex-col overflow-hidden pb-10" className="-mx-[17px] flex h-dvh flex-col overflow-hidden pb-10"
style={mainStyle} style={mainStyle}
> >
<StickyHeader sticky={false} className="shrink-0">
<StickyHeader sticky className="shrink-0">
<div className="flex items-center justify-between gap-3"> <div className="flex items-center justify-between gap-3">
<NavigationButton <NavigationButton
variant="transparent" variant="transparent"
@ -68,7 +68,7 @@ export default function MarriageAdvisorsPage({
</div> </div>
</StickyHeader> </StickyHeader>
<section className="flex-1 overflow-y-auto overflow-x-hidden px-[17px] pb-32 pt-5 flex flex-col items-center gap-4">
<section className="min-h-0 flex-1 overflow-y-auto overflow-x-hidden px-[17px] pb-32 pt-5 flex flex-col items-center gap-4">
{isLoading && <AdvisorsSkeleton />} {isLoading && <AdvisorsSkeleton />}
{isError && ( {isError && (

12
src/app/new-match/profile/page.tsx

@ -181,12 +181,12 @@ function NewMatchProfileSkeleton({
<> <>
<PageBackground /> <PageBackground />
<main className="-mx-[17px] flex h-dvh flex-col overflow-hidden bg-[#F5F5F5]"> <main className="-mx-[17px] flex h-dvh flex-col overflow-hidden bg-[#F5F5F5]">
<StickyHeader sticky={false} className="shrink-0">
<StickyHeader sticky className="shrink-0">
<div className="flex items-center justify-between gap-3"> <div className="flex items-center justify-between gap-3">
{!hideBackButton ? ( {!hideBackButton ? (
<NavigationButton <NavigationButton
variant="transparent" variant="transparent"
icon="exit"
icon="back"
iconLabel={t["Go back"]} iconLabel={t["Go back"]}
onClick={onClose} onClick={onClose}
/> />
@ -203,7 +203,7 @@ function NewMatchProfileSkeleton({
</div> </div>
</StickyHeader> </StickyHeader>
<section className="flex-1 overflow-y-auto overflow-x-hidden px-[17px] pb-6 pt-5">
<section className="min-h-0 flex-1 overflow-y-auto overflow-x-hidden px-[17px] pb-6 pt-5">
<div className="flex flex-col items-center justify-center w-full"> <div className="flex flex-col items-center justify-center w-full">
<LoadingSkeleton className="size-[90px] rounded-full shadow-sm" /> <LoadingSkeleton className="size-[90px] rounded-full shadow-sm" />
<LoadingSkeleton className="mt-3.5 h-7 w-44 rounded-xl shadow-xs" /> <LoadingSkeleton className="mt-3.5 h-7 w-44 rounded-xl shadow-xs" />
@ -619,11 +619,11 @@ export default function NewMatchProfilePage({
) : null} ) : null}
<main className={mainClass} style={mainStyle}> <main className={mainClass} style={mainStyle}>
<StickyHeader sticky={false} className="shrink-0">
<StickyHeader sticky className="shrink-0">
<div className="flex items-center justify-between gap-3"> <div className="flex items-center justify-between gap-3">
<NavigationButton <NavigationButton
variant="transparent" variant="transparent"
icon="exit"
icon="back"
iconLabel={t["Go back"]} iconLabel={t["Go back"]}
onClick={onClose} onClick={onClose}
/> />
@ -637,7 +637,7 @@ export default function NewMatchProfilePage({
</div> </div>
</StickyHeader> </StickyHeader>
<section className="flex-1 overflow-y-auto overflow-x-hidden px-[17px] pb-6 pt-5">
<section className="min-h-0 flex-1 overflow-y-auto overflow-x-hidden px-[17px] pb-6 pt-5">
<div <div
className="mx-auto flex flex-col items-center justify-center" className="mx-auto flex flex-col items-center justify-center"
style={{ style={{

Loading…
Cancel
Save