[통합로그 No.4] Home Shelf 이동 시 해당 Shelf에 맞는 정보 수집

This commit is contained in:
dongyoungKo
2025-05-12 18:04:22 +09:00
parent b68888a3b5
commit 80bcae4cae
10 changed files with 154 additions and 66 deletions

View File

@@ -26,6 +26,7 @@ export default function HomeBanner({
firstSpot,
spotlightId,
handleItemFocus,
handleShelfFocus,
}) {
const dispatch = useDispatch();
@@ -49,6 +50,12 @@ export default function HomeBanner({
}
}, [handleItemFocus]);
const _handleShelfFocus = useCallback(() => {
if (handleShelfFocus) {
handleShelfFocus();
}
}, [handleShelfFocus]);
const defaultFocus = useMemo(() => {
if (bannerDataList) {
let targetIndex = 0;
@@ -102,6 +109,7 @@ export default function HomeBanner({
isHorizontal={isHorizontal}
key={"banner" + index}
spotlightId={"banner" + index}
handleShelfFocus={_handleShelfFocus}
handleItemFocus={_handleItemFocus}
/>
) : data.shptmDspyTpNm === "Random" ? (
@@ -110,6 +118,7 @@ export default function HomeBanner({
isHorizontal={isHorizontal}
key={"banner" + index}
spotlightId={"banner" + index}
handleShelfFocus={_handleShelfFocus}
handleItemFocus={_handleItemFocus}
randomNumber={data.randomIndex}
/>
@@ -133,7 +142,7 @@ export default function HomeBanner({
</div>
);
},
[_handleItemFocus, bannerDataList]
[_handleItemFocus, _handleShelfFocus, bannerDataList]
);
const renderLayout = useCallback(() => {