From eaca8e7d7d7bab017108db4c9fa509c80d5a4171 Mon Sep 17 00:00:00 2001 From: mortezaei Date: Wed, 26 Aug 2026 19:24:38 +0330 Subject: [PATCH] fix start --- .../finding-match/finding-match-client.tsx | 33 ++++++++++++-- src/app/globals.css | 44 +++++++++++++++++++ .../questions-list/questions-list-client.tsx | 2 +- 3 files changed, 75 insertions(+), 4 deletions(-) diff --git a/src/app/finding-match/finding-match-client.tsx b/src/app/finding-match/finding-match-client.tsx index 42de9d8..77077b2 100644 --- a/src/app/finding-match/finding-match-client.tsx +++ b/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() {
- + { + if (typeof window !== "undefined" && (window as any).HabibApp) { + (window as any).HabibApp.postMessage( + JSON.stringify({ action: "close_service" }), + ); + } else { + router.push(localizePath("/", locale)); + } + }, + }} + />
) : ( - diff --git a/src/app/globals.css b/src/app/globals.css index c4e10b5..c5abd06 100644 --- a/src/app/globals.css +++ b/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; + } +} + diff --git a/src/app/questions-list/questions-list-client.tsx b/src/app/questions-list/questions-list-client.tsx index 369086f..e468b76 100644 --- a/src/app/questions-list/questions-list-client.tsx +++ b/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