[통합로그 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

@@ -77,6 +77,7 @@ export default function RollingUnit({
spotlightId,
isHorizontal,
handleItemFocus,
handleShelfFocus,
}) {
const rollingData = bannerData.bannerDetailInfos;
const rollingDataLength = bannerData.bannerDetailInfos.length;
@@ -289,6 +290,12 @@ export default function RollingUnit({
}, 300);
}, []);
const shelfFocus = useCallback(() => {
if (handleShelfFocus) {
handleShelfFocus();
}
}, [handleShelfFocus]);
const categoryData = useMemo(() => {
if (
Object.keys(rollingData[startIndex]).length > 0 &&
@@ -539,6 +546,7 @@ export default function RollingUnit({
isHorizontal && css.isHorizontalWrap
)}
spotlightId={`container-${spotlightId}`}
onFocus={shelfFocus}
>
{rollingDataLength !== 1 ? (
<SpottableComponent