diff --git a/src/components/pages/ABDesign/v1/pages/TrialPayment/components/PersonalVideo/index.tsx b/src/components/pages/ABDesign/v1/pages/TrialPayment/components/PersonalVideo/index.tsx index 084a82e..80867ff 100644 --- a/src/components/pages/ABDesign/v1/pages/TrialPayment/components/PersonalVideo/index.tsx +++ b/src/components/pages/ABDesign/v1/pages/TrialPayment/components/PersonalVideo/index.tsx @@ -5,8 +5,6 @@ import Loader from "@/components/Loader"; import PlayButton from "../../../../ui/PlayButton"; import metricService, { EGoals } from "@/services/metric/metricService"; import PlayPauseButton from "../../../../ui/PlayPauseButton"; -import VideoOverlay from "../../../../ui/VideoOverlay"; -import PlayPauseButtonV2 from "../../../../ui/PlayPauseButtonV2"; interface IPersonalVideoProps { gender: string; @@ -19,7 +17,6 @@ const PersonalVideo = React.memo( const [isPlaying, setIsPlaying] = useState(false); const [isStarted, setIsStarted] = useState(false); const [isError, setIsError] = useState(false); - const [isOverlayShow, setIsOverlayShow] = useState(false); const onError = (error: unknown) => { if (!error) return; @@ -36,27 +33,14 @@ const PersonalVideo = React.memo( metricService.reachGoal(EGoals.ROSE_VIDEO_PLAY_END); }; - const handlePlayPause = ( - event: React.MouseEvent - ) => { - event.preventDefault(); - event.stopPropagation(); + const handlePlayPause = () => { setIsPlaying((prev) => !prev); if (isPlaying) metricService.reachGoal(EGoals.ROSE_VIDEO_PLAY_USER_PLAY); if (!isPlaying) metricService.reachGoal(EGoals.ROSE_VIDEO_PLAY_USER_STOP); }; return ( -
setIsOverlayShow(true)} - > - - handlePlayPause(event)} - /> - +
{!isPlaying && !isError && !isStarted && ( )} @@ -64,9 +48,7 @@ const PersonalVideo = React.memo( { - event.preventDefault(); - event.stopPropagation(); + onClick={() => { setIsError(false); setIsPlaying(true); }} @@ -90,10 +72,10 @@ const PersonalVideo = React.memo( aspectRatio: "16 / 9", }} /> - {!isError && isStarted && !isOverlayShow && ( + {!isError && isStarted && ( handlePlayPause(event)} + onClick={handlePlayPause} className={styles["play-pause-button"]} /> )} diff --git a/src/components/pages/ABDesign/v1/pages/TrialPayment/index.tsx b/src/components/pages/ABDesign/v1/pages/TrialPayment/index.tsx index 0c69da7..b986db9 100644 --- a/src/components/pages/ABDesign/v1/pages/TrialPayment/index.tsx +++ b/src/components/pages/ABDesign/v1/pages/TrialPayment/index.tsx @@ -144,13 +144,6 @@ function TrialPaymentPage() { classNameContainer={styles["personal-video"]} /> )} - {/* {!!videoUrl.length && ( */} - - {/* )} */} {singleOrWithPartner === "partner" && ( null} {...props} > diff --git a/src/components/pages/ABDesign/v1/ui/PlayPauseButtonV2/index.tsx b/src/components/pages/ABDesign/v1/ui/PlayPauseButtonV2/index.tsx deleted file mode 100644 index 8ea057d..0000000 --- a/src/components/pages/ABDesign/v1/ui/PlayPauseButtonV2/index.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import { DetailedHTMLProps, HTMLAttributes } from "react"; -import styles from "./styles.module.scss"; - -interface IPlayPauseButtonV2Props { - state?: "play" | "pause"; -} - -function PlayPauseButtonV2({ - state, - ...props -}: IPlayPauseButtonV2Props & - DetailedHTMLProps, HTMLDivElement>) { - return ( -
- {state === "pause" ? ( - - - - - ) : ( - - - - )} -
- ); -} - -export default PlayPauseButtonV2; diff --git a/src/components/pages/ABDesign/v1/ui/PlayPauseButtonV2/styles.module.scss b/src/components/pages/ABDesign/v1/ui/PlayPauseButtonV2/styles.module.scss deleted file mode 100644 index e69de29..0000000 diff --git a/src/components/pages/ABDesign/v1/ui/VideoOverlay/index.tsx b/src/components/pages/ABDesign/v1/ui/VideoOverlay/index.tsx deleted file mode 100644 index 611c70c..0000000 --- a/src/components/pages/ABDesign/v1/ui/VideoOverlay/index.tsx +++ /dev/null @@ -1,65 +0,0 @@ -import { useEffect, useRef, useState } from "react"; -import styles from "./styles.module.scss"; - -interface IVideoOverlayProps { - isShow: boolean; - setIsShow: React.Dispatch>; - animationDuration?: number; - children?: React.ReactNode; -} - -function VideoOverlay({ - isShow, - setIsShow, - animationDuration = 5000, - children, -}: IVideoOverlayProps) { - const timeoutRef = useRef(); - const [animationDurationLocal, setAnimationDurationLocal] = - useState(animationDuration); - - const click = () => { - if (timeoutRef.current) clearTimeout(timeoutRef.current); - setAnimationDurationLocal((prev) => prev + animationDuration); - timeoutRef.current = setTimeout(() => { - setIsShow(false); - }, animationDuration); - }; - - useEffect(() => { - if (!isShow) return; - console.log("start "); - - timeoutRef.current = setTimeout(() => { - setIsShow(false); - }, animationDuration); - return () => { - if (timeoutRef.current) clearTimeout(timeoutRef.current); - }; - }, [animationDuration, isShow, setIsShow]); - - return ( - <> - {isShow && ( -
-
- {children} -
-
- )} - - ); -} - -export default VideoOverlay; diff --git a/src/components/pages/ABDesign/v1/ui/VideoOverlay/styles.module.scss b/src/components/pages/ABDesign/v1/ui/VideoOverlay/styles.module.scss deleted file mode 100644 index 6b67102..0000000 --- a/src/components/pages/ABDesign/v1/ui/VideoOverlay/styles.module.scss +++ /dev/null @@ -1,46 +0,0 @@ -.overlay { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - background-color: rgba(0, 0, 0, 0); - z-index: 9999; - display: flex; - align-items: center; - justify-content: center; - animation-fill-mode: forwards; - animation-name: appearance, disappearing; - animation-duration: 0.5s; -} - -@keyframes appearance { - to { - background-color: rgba(0, 0, 0, 0.27); - } -} - -@keyframes disappearing { - to { - background-color: rgba(0, 0, 0, 0); - } -} - -.content { - opacity: 0; - animation-fill-mode: forwards; - animation-name: appearance-content, disappearing-content; - animation-duration: 0.5s; -} - -@keyframes appearance-content { - to { - opacity: 1; - } -} - -@keyframes disappearing-content { - to { - opacity: 0; - } -}