diff --git a/src/components/Histories.tsx b/src/components/Histories.tsx index a20a1c0..20bec09 100644 --- a/src/components/Histories.tsx +++ b/src/components/Histories.tsx @@ -45,6 +45,14 @@ function Histories() { trackMouse: true, }); + useEffect(() => { + if (!videoRefs[0].current?.src) return; + const width = videoRefs[0].current.clientWidth; + const height = videoRefs[0].current.clientHeight; + setVideoWidth(width); + setVideoHeigth(height); + }, [videoRefs[0]]); + function handleEnded() { if (selectedVideoIndex === VIDEOS.length - 1) { setSelectedVideoIndex(0); @@ -180,12 +188,12 @@ function Histories() { playsInline className="aspect-[9/16] object-cover w-full h-full min-w-screen" onEnded={handleEnded} - onLoadedData={() => - setTimeout(() => { - setVideoWidth(videoRefs[0].current!.clientWidth); - setVideoHeigth(videoRefs[0].current!.clientHeight); - }, 200) - } + // onLoadedData={() => + // setTimeout(() => { + // setVideoWidth(videoRefs[0].current!.clientWidth); + // setVideoHeigth(videoRefs[0].current!.clientHeight); + // }, 200) + // } />
Показать еще
diff --git a/src/components/Reviews.tsx b/src/components/Reviews.tsx index 449bf82..e855453 100644 --- a/src/components/Reviews.tsx +++ b/src/components/Reviews.tsx @@ -13,6 +13,7 @@ import { Video } from "../types/Video"; import ArrowLeftIcon from "./icons/ArrowLeftIcon"; import ArrowRightIcon from "./icons/ArrowRightIcon"; import { Transition } from "react-transition-group"; +import PlayerIcon from "./icons/PlayerIcon"; type Review = { id: string; @@ -67,9 +68,7 @@ function Reviews() { }); useEffect(() => { - // console.log("first", videoRefs[0].current?.src); if (!imageRefs[0].current?.src) return; - console.log("videoRefs[0].current?.src", imageRefs[0].current?.src); const width = imageRefs[0].current.clientWidth; setImageWidth(width); }, [imageRefs[0]]); @@ -93,9 +92,9 @@ function Reviews() { return (- Отзывы -
-клиентов
- - -- {item.name} -
-- {item.position} -
-- {item.desc} +
+ Отзывы +
+клиентов
+ ++ {" "} + {REVIEWS[selectedImageIndex].name} +
++ {REVIEWS[selectedImageIndex].position}
+ {REVIEWS[selectedImageIndex].desc} +
+