|
|
@ -488,6 +488,7 @@ export default function NewMatchClient() { |
|
|
const { isAdvisorOpen, openAdvisors, closeAdvisors } = |
|
|
const { isAdvisorOpen, openAdvisors, closeAdvisors } = |
|
|
useMarriageAdvisorsOverlay(); |
|
|
useMarriageAdvisorsOverlay(); |
|
|
const { isProfileOpen, openProfile, closeProfile } = useMatchProfileOverlay(); |
|
|
const { isProfileOpen, openProfile, closeProfile } = useMatchProfileOverlay(); |
|
|
|
|
|
const [isOpeningProfile, setIsOpeningProfile] = useState(false); |
|
|
const { data: profile, isError, isLoading } = useMarriageProfileQuery(); |
|
|
const { data: profile, isError, isLoading } = useMarriageProfileQuery(); |
|
|
const [isPaymentSheetOpen, setIsPaymentSheetOpen] = useState(false); |
|
|
const [isPaymentSheetOpen, setIsPaymentSheetOpen] = useState(false); |
|
|
const [isDeclineConfirmOpen, setIsDeclineConfirmOpen] = useState(false); |
|
|
const [isDeclineConfirmOpen, setIsDeclineConfirmOpen] = useState(false); |
|
|
@ -594,8 +595,23 @@ export default function NewMatchClient() { |
|
|
} |
|
|
} |
|
|
}, [profile, locale, router, isLoading, isError]); |
|
|
}, [profile, locale, router, isLoading, isError]); |
|
|
|
|
|
|
|
|
// Signal Flutter to lift its loading cover once the profile is available.
|
|
|
|
|
|
useHabibWebReady(!!profile && !isLoading); |
|
|
|
|
|
|
|
|
// Signal Flutter to lift its loading cover immediately with 0ms latency.
|
|
|
|
|
|
useHabibWebReady(true); |
|
|
|
|
|
|
|
|
|
|
|
const handleOpenProfile = () => { |
|
|
|
|
|
if (profile) { |
|
|
|
|
|
openProfile(); |
|
|
|
|
|
} else { |
|
|
|
|
|
setIsOpeningProfile(true); |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
|
if (isOpeningProfile && profile) { |
|
|
|
|
|
setIsOpeningProfile(false); |
|
|
|
|
|
openProfile(); |
|
|
|
|
|
} |
|
|
|
|
|
}, [isOpeningProfile, profile, openProfile]); |
|
|
|
|
|
|
|
|
const isRedirecting = useMemo(() => { |
|
|
const isRedirecting = useMemo(() => { |
|
|
if (!profile) return false; |
|
|
if (!profile) return false; |
|
|
@ -625,65 +641,6 @@ export default function NewMatchClient() { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if ((isLoading && !profile) || !profile) { |
|
|
|
|
|
return ( |
|
|
|
|
|
<> |
|
|
|
|
|
<PageBackground /> |
|
|
|
|
|
<PageHeader profile={profile} sticky /> |
|
|
|
|
|
|
|
|
|
|
|
<main |
|
|
|
|
|
style={{ |
|
|
|
|
|
paddingBottom: `${20 + bottom}px`, |
|
|
|
|
|
}} |
|
|
|
|
|
className="min-h-0 flex-1 flex flex-col gap-3.5 pt-4 pb-1 text-center" |
|
|
|
|
|
> |
|
|
|
|
|
{/* 1. Header Section Skeleton */} |
|
|
|
|
|
<section className="flex flex-col items-center shrink-0"> |
|
|
|
|
|
<LoadingSkeleton className="h-[56px] w-[56px] rounded-full" /> |
|
|
|
|
|
<LoadingSkeleton className="h-6 w-[200px] mt-2.5" /> |
|
|
|
|
|
<LoadingSkeleton className="h-3.5 w-[260px] mt-1.5" /> |
|
|
|
|
|
</section> |
|
|
|
|
|
|
|
|
|
|
|
{/* 2. Match Card Skeleton */} |
|
|
|
|
|
<section className="w-full rounded-[16px] border border-white/80 bg-white px-4 py-4 shadow-none flex flex-col items-center shrink-0"> |
|
|
|
|
|
{/* Name line */} |
|
|
|
|
|
<LoadingSkeleton className="h-4 w-[130px]" /> |
|
|
|
|
|
|
|
|
|
|
|
{/* Subtitle / Details lines */} |
|
|
|
|
|
<div className="mt-2.5 w-full flex flex-col items-center gap-2 min-h-[40px]"> |
|
|
|
|
|
<LoadingSkeleton className="h-3 w-[180px]" /> |
|
|
|
|
|
<LoadingSkeleton className="h-3 w-[150px]" /> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
{/* Button skeleton */} |
|
|
|
|
|
<LoadingSkeleton className="mt-3.5 h-[40px] w-full rounded-[10px]" /> |
|
|
|
|
|
</section> |
|
|
|
|
|
|
|
|
|
|
|
{/* 3. Advisor Card Skeleton */} |
|
|
|
|
|
<section className="w-full shrink-0"> |
|
|
|
|
|
<div className="rounded-[14px] border border-white/80 bg-white/75 px-4 py-3.5 text-left shadow-none backdrop-blur-sm"> |
|
|
|
|
|
<LoadingSkeleton className="h-4 w-[120px]" /> |
|
|
|
|
|
<div className="mt-1.5 space-y-1"> |
|
|
|
|
|
<LoadingSkeleton className="h-2.5 w-[240px]" /> |
|
|
|
|
|
<LoadingSkeleton className="h-2.5 w-[160px]" /> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div className="mt-3.5 flex items-center justify-between gap-3"> |
|
|
|
|
|
<div className="flex items-center pl-1"> |
|
|
|
|
|
<LoadingSkeleton className="h-[28px] w-[28px] rounded-full border-2 border-white" /> |
|
|
|
|
|
<LoadingSkeleton className="-ml-1.5 h-[28px] w-[28px] rounded-full border-2 border-white" /> |
|
|
|
|
|
<LoadingSkeleton className="-ml-1.5 h-[28px] w-[28px] rounded-full border-2 border-white" /> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<LoadingSkeleton className="h-[36px] w-[100px] rounded-[9px]" /> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</section> |
|
|
|
|
|
</main> |
|
|
|
|
|
</> |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const isFemaleProfile = profile?.gender === "female"; |
|
|
const isFemaleProfile = profile?.gender === "female"; |
|
|
const matchHeadingTitle = isFemaleProfile |
|
|
const matchHeadingTitle = isFemaleProfile |
|
|
? t["New Marriage Proposal"] |
|
|
? t["New Marriage Proposal"] |
|
|
@ -868,11 +825,12 @@ export default function NewMatchClient() { |
|
|
{/* Button */} |
|
|
{/* Button */} |
|
|
<button |
|
|
<button |
|
|
type="button" |
|
|
type="button" |
|
|
|
|
|
disabled={isOpeningProfile && isLoading} |
|
|
onClick={() => { |
|
|
onClick={() => { |
|
|
if (isMale && !hasActiveSub) { |
|
|
if (isMale && !hasActiveSub) { |
|
|
setIsPaymentSheetOpen(true); |
|
|
setIsPaymentSheetOpen(true); |
|
|
} else { |
|
|
} else { |
|
|
openProfile(); |
|
|
|
|
|
|
|
|
handleOpenProfile(); |
|
|
} |
|
|
} |
|
|
}} |
|
|
}} |
|
|
className=" |
|
|
className=" |
|
|
@ -895,8 +853,14 @@ export default function NewMatchClient() { |
|
|
border-none |
|
|
border-none |
|
|
" |
|
|
" |
|
|
> |
|
|
> |
|
|
<Ic name="eye" className="size-5 text-white" /> |
|
|
|
|
|
<span>{t["View more details"]}</span> |
|
|
|
|
|
|
|
|
{isOpeningProfile && isLoading ? ( |
|
|
|
|
|
<LoadingThreeDot /> |
|
|
|
|
|
) : ( |
|
|
|
|
|
<> |
|
|
|
|
|
<Ic name="eye" className="size-5 text-white" /> |
|
|
|
|
|
<span>{t["View more details"]}</span> |
|
|
|
|
|
</> |
|
|
|
|
|
)} |
|
|
</button> |
|
|
</button> |
|
|
</div> |
|
|
</div> |
|
|
</> |
|
|
</> |
|
|
|