Browse Source

fix start

master
mortezaei 7 hours ago
parent
commit
eaca8e7d7d
  1. 33
      src/app/finding-match/finding-match-client.tsx
  2. 44
      src/app/globals.css
  3. 2
      src/app/questions-list/questions-list-client.tsx

33
src/app/finding-match/finding-match-client.tsx

@ -3,6 +3,7 @@
import Image from "next/image";
import { useRouter } from "next/navigation";
import { useEffect, useMemo } from "react";
import { useHardwareBackHandler } from "@/hooks/use-hardware-back-handler";
import { useHabibWebReady } from "@/hooks/use-habib-web-ready";
import { Ic } from "@/icons";
import AdvisorActionsCard from "@/components/Componentes/advisor-actions-card";
@ -38,6 +39,14 @@ export default function FindingMatchClient() {
const { mutate: markRejectionSeen, isPending: isMarkingSeen } =
useRejectionSeenMutation();
useHardwareBackHandler(() => {
if (isAdvisorOpen) {
closeAdvisors();
return true;
}
return false; // Hardware back closes the service in Flutter
});
useEffect(() => {
if (!profile) {
return;
@ -86,9 +95,24 @@ export default function FindingMatchClient() {
<main
style={{ paddingBottom: "calc(100px + var(--safe-bottom))" }}
className="-mx-[17px] flex min-h-screen flex-col px-[23px] pt-[max(12px,calc(var(--safe-top)+4px))] text-center"
className="-mx-[17px] flex min-h-screen flex-col px-[23px] pt-[max(12px,calc(var(--safe-top)+4px))] text-center page-slide-enter"
>
<PageHeader className="-mx-[6px]" />
<PageHeader
className="-mx-[6px]"
profile={profile}
leftButton={{
icon: "back",
onClick: () => {
if (typeof window !== "undefined" && (window as any).HabibApp) {
(window as any).HabibApp.postMessage(
JSON.stringify({ action: "close_service" }),
);
} else {
router.push(localizePath("/", locale));
}
},
}}
/>
<section className="mt-20 flex flex-1 flex-col items-center">
<div className="relative h-[124px] w-[130px]" aria-hidden="true">
@ -173,7 +197,10 @@ export default function FindingMatchClient() {
</span>
</div>
) : (
<Button variant="dark" href="/questions-list">
<Button
variant="dark"
href={localizePath("/questions-list", locale)}
>
<Ic name="pencil" aria-hidden="true" className="h-3.5 w-3.5 shrink-0" />
<span>{copy.editProfile}</span>
</Button>

44
src/app/globals.css

@ -598,3 +598,47 @@ span.shimmer-bg,
span.shimmer-white-bg {
display: inline-block;
}
/* ─── Screen Slide-in Page Transition ─── */
@keyframes screen-slide-in-ltr {
from {
transform: translate3d(100%, 0, 0);
opacity: 0.95;
}
to {
transform: translate3d(0, 0, 0);
opacity: 1;
}
}
@keyframes screen-slide-in-rtl {
from {
transform: translate3d(-100%, 0, 0);
opacity: 0.95;
}
to {
transform: translate3d(0, 0, 0);
opacity: 1;
}
}
.page-slide-enter {
animation: screen-slide-in-ltr 320ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
will-change: transform, opacity;
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
}
[dir="rtl"] .page-slide-enter,
:dir(rtl) .page-slide-enter {
animation: screen-slide-in-rtl 320ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@media (prefers-reduced-motion: reduce) {
.page-slide-enter,
[dir="rtl"] .page-slide-enter,
:dir(rtl) .page-slide-enter {
animation: none !important;
}
}

2
src/app/questions-list/questions-list-client.tsx

@ -136,7 +136,7 @@ export default function QuestionsListClient() {
const startMatchMutation = useStartMarriageMatchMutation({
onSuccess: () => {
markMatchStarted();
router.push(localizePath("/finding-match", locale));
router.replace(localizePath("/finding-match", locale));
},
onError: () => {
// Never pretend the request went through – the user stays here and can

Loading…
Cancel
Save