[지라이슈없음] fetauredBrands scoll 위치 변경

This commit is contained in:
고동영
2025-01-15 13:13:11 +09:00
parent 1c33974888
commit 5afcea504c

View File

@@ -655,7 +655,12 @@ export default function TabLayout({ topPanelName, onTabActivated, panelInfo }) {
}, [tabActivated, subTabLastFocusId, mainSelectedIndex]);
useEffect(() => {
const SCROLL_OFFSET_INDEX = 9;
const hasFeaturedBrands =
tabs[mainSelectedIndex]?.children[0]?.path !== undefined;
const SCROLL_OFFSET_INDEX = hasFeaturedBrands ? 8 : 9;
const y = hasFeaturedBrands ? 110 : 100;
if (selectedSubIndex >= 0) {
if (selectedSubIndex === 0) {
@@ -670,7 +675,7 @@ export default function TabLayout({ topPanelName, onTabActivated, panelInfo }) {
) {
const targetScrollIndex = selectedSubIndex - SCROLL_OFFSET_INDEX;
scrollTopJobRef.current.start(() =>
scrollTop({ y: 100 * targetScrollIndex })
scrollTop({ y: y * targetScrollIndex })
);
return () => scrollTopJobRef.current.stop();