[SHOPTIME-3738] Theme Detail / FHD 에서 썸네일을 선택 시 화면 스크롤 오류
Changed files: 1. ThemeIndicator.jsx Detail note: 원인: scroll 계산식의 해상도 미고려 대책: 해상도를 고려하여 scroll 계산식 수정
This commit is contained in:
@@ -18,7 +18,7 @@ import CustomImage from "../../../../components/CustomImage/CustomImage";
|
||||
import TVirtualGridList from "../../../../components/TVirtualGridList/TVirtualGridList";
|
||||
import useScrollTo from "../../../../hooks/useScrollTo";
|
||||
import { panel_names } from "../../../../utils/Config";
|
||||
import { $L, scaleW } from "../../../../utils/helperMethods";
|
||||
import { $L, scaleH, scaleW } from "../../../../utils/helperMethods";
|
||||
import css from "./ThemeIndicator.module.less";
|
||||
import ThemeIndicatorArrow from "./ThemeIndicatorArrow";
|
||||
|
||||
@@ -28,7 +28,7 @@ const Container = SpotlightContainerDecorator(
|
||||
);
|
||||
const SpottableComponent = Spottable("div");
|
||||
|
||||
const IMAGE_WIDTH = scaleW(152);
|
||||
const IMAGE_HEIGHT = scaleH(152);
|
||||
|
||||
function ThemeIndicator({
|
||||
selectedIndex,
|
||||
@@ -55,7 +55,7 @@ function ThemeIndicator({
|
||||
const topPanel = panels[panels.length - 1];
|
||||
const { getScrollTo, scrollTop } = useScrollTo();
|
||||
|
||||
let imagePosition = IMAGE_WIDTH * selectedIndex - IMAGE_WIDTH;
|
||||
let imagePosition = IMAGE_HEIGHT * selectedIndex - IMAGE_HEIGHT;
|
||||
|
||||
const canPlayVideo = useMemo(() => {
|
||||
return themeProductInfo?.prdtMediaUrl && imageSelectedIndex === 0;
|
||||
@@ -176,7 +176,7 @@ function ThemeIndicator({
|
||||
setSelectedIndex((prev) => prev - 1);
|
||||
setImageSelectedIndex(0);
|
||||
if (themeProductInfos.length - 1 !== selectedIndex) {
|
||||
scrollTop({ y: imagePosition - IMAGE_WIDTH, animate: true });
|
||||
scrollTop({ y: imagePosition - IMAGE_HEIGHT, animate: true });
|
||||
}
|
||||
}, [selectedIndex]);
|
||||
|
||||
@@ -250,7 +250,7 @@ function ThemeIndicator({
|
||||
return;
|
||||
}
|
||||
if (selectedIndex >= 3) {
|
||||
scrollTop({ y: 144 * selectedIndex });
|
||||
scrollTop({ y: IMAGE_HEIGHT * selectedIndex });
|
||||
}
|
||||
if (
|
||||
themeProductInfos &&
|
||||
|
||||
Reference in New Issue
Block a user