diff --git a/src/components/Componentes/slider-page.tsx b/src/components/Componentes/slider-page.tsx index 7cc1677..0a46f21 100644 --- a/src/components/Componentes/slider-page.tsx +++ b/src/components/Componentes/slider-page.tsx @@ -33,6 +33,7 @@ export default function SliderPage() { useState("self"); const [hasReadRules, setHasReadRules] = useState(false); const [touchStartX, setTouchStartX] = useState(null); + const [touchStartY, setTouchStartY] = useState(null); const updateProfileBasicMutation = useUpdateMarriageProfileBasicMutation(); const queryClient = useQueryClient(); const [submitError, setSubmitError] = useState(null); @@ -120,20 +121,27 @@ export default function SliderPage() { const handleTouchStart = (event: TouchEvent) => { setTouchStartX(event.touches[0]?.clientX ?? null); + setTouchStartY(event.touches[0]?.clientY ?? null); }; const handleTouchEnd = (event: TouchEvent) => { - if (touchStartX === null) { + if (touchStartX === null || touchStartY === null) { return; } const touchEndX = event.changedTouches[0]?.clientX ?? touchStartX; + const touchEndY = event.changedTouches[0]?.clientY ?? touchStartY; const deltaX = touchStartX - touchEndX; + const deltaY = touchStartY - touchEndY; - if (Math.abs(deltaX) >= SWIPE_THRESHOLD) { + if ( + Math.abs(deltaX) >= SWIPE_THRESHOLD && + Math.abs(deltaX) > Math.abs(deltaY) * 1.5 + ) { if (deltaX > 0) { if (activeSlide === 0 && !hasReadRules) { setTouchStartX(null); + setTouchStartY(null); return; } goToNextSlide(); @@ -143,6 +151,7 @@ export default function SliderPage() { } setTouchStartX(null); + setTouchStartY(null); }; return ( diff --git a/src/components/Componentes/slider-slide-two.tsx b/src/components/Componentes/slider-slide-two.tsx index 5b117f5..9d08344 100644 --- a/src/components/Componentes/slider-slide-two.tsx +++ b/src/components/Componentes/slider-slide-two.tsx @@ -3,6 +3,7 @@ import Image from "next/image"; import { useState } from "react"; import { useMarriageConfigQuery } from "@/hooks/marriage/use-marriage-config"; +import { useI18n } from "@/translations/provider"; import { SliderHeader } from "./slider-header"; import type { SliderSlideProps } from "./slider-slide"; import VideoPlayer from "./video-player"; @@ -11,6 +12,7 @@ import NetworkImage from "./network-image"; export function SliderSlideTwo({ index }: SliderSlideProps) { const [isPlayerOpen, setIsPlayerOpen] = useState(false); const { data: config } = useMarriageConfigQuery(); + const { dictionary: t } = useI18n(); const thumbnailSrc = config?.video_step_2_thumbnail_url || @@ -24,13 +26,16 @@ export function SliderSlideTwo({ index }: SliderSlideProps) { aria-label={`Slide ${index + 1}`} className="flex h-full min-h-0 w-full shrink-0 flex-col" > -
- +
+
+ +
+
setIsPlayerOpen(true)} > -
+
-
+ +
Dr. Hasti Masoudi

- Dr. Hasti Masoudi + {t["Dr. Hasti Masoudi"] || "Dr. Hasti Masoudi"}

-

- We have come together with the goal of creating a secure and - confidential path for "permanent marriage" among Muslims +

+ {t[ + 'We have come together with the goal of creating a secure and confidential path for "permanent marriage" among Muslims' + ] || + 'We have come together with the goal of creating a secure and confidential path for "permanent marriage" among Muslims'}