From 66555450cfed961b96fa33702c0f2dfe7a1c4081 Mon Sep 17 00:00:00 2001 From: Nik Tverd <61203447+niktverd@users.noreply.github.com> Date: Fri, 6 Oct 2023 19:29:22 +0600 Subject: [PATCH] chore: refactor parallax in Image (#578) --- src/components/Media/Image/Image.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Media/Image/Image.tsx b/src/components/Media/Image/Image.tsx index de309d5f3..830d6c2e0 100644 --- a/src/components/Media/Image/Image.tsx +++ b/src/components/Media/Image/Image.tsx @@ -73,8 +73,8 @@ const Image = (props: ImageAllProps) => { if (parallax) { const parallaxLevel = 2; - springSetScrollY({springScrollY: height && scrollY > height ? height : scrollY}); - parallaxInterpolate = springScrollY.interpolate( + springSetScrollY.start({springScrollY: height && scrollY > height ? height : scrollY}); + parallaxInterpolate = springScrollY.to( (value) => `translateY(-${Number(value) / parallaxLevel}px)`, ); }