[홈패널] 이미지배너 링크 연동 / 홈투데이 클릭 이벤트 변경

This commit is contained in:
sungmin.in
2024-02-27 19:40:50 +09:00
parent 57434236e5
commit 41d7bafed7
2 changed files with 44 additions and 12 deletions

View File

@@ -33,6 +33,7 @@ export default function ImageBannerUnit({
productName,
soldoutFlag,
isHorizontal,
shptmLnkTpNm,
rolling,
startIndex,
lastIndex,
@@ -47,11 +48,38 @@ export default function ImageBannerUnit({
const handleClick = useCallback(() => {
console.log("파트너ID", patnrId);
console.log("상품", prdtId);
let panelName = "";
if (shptmLnkTpNm === "Featured Brands") {
panelName = panel_names.FEATURED_BRANDS_PANEL;
} else if (shptmLnkTpNm === "Trending now") {
panelName = panel_names.TRENDING_NOW_PANEL;
} else if (shptmLnkTpNm === "HOT PICKS") {
panelName = panel_names.HOT_PICKS_PANEL;
} else if (shptmLnkTpNm === "ON SALE") {
panelName = panel_names.ON_SALE_PANEL;
} else if (shptmLnkTpNm === "CATEGORY") {
panelName = panel_names.CATEGORY_PANEL;
} else if (shptmLnkTpNm === "Product Detail") {
panelName = panel_names.DETAIL_PANEL;
} else if (shptmLnkTpNm === "VOD") {
panelName = "";
} else if (shptmLnkTpNm === "Show Detail") {
panelName = "";
} else {
panelName = panel_names.HOME_PANEL;
}
// panel_names.DETAIL_PANEL,
dispatch(
pushPanel({
name: panel_names.DETAIL_PANEL,
panelInfo: { patnrId: patnrId, prdtId: prdtId },
})
pushPanel(
{
name: panelName,
panelInfo: { patnrId: patnrId, prdtId: prdtId },
},
[]
)
);
}, [dispatch, patnrId, prdtId]);
@@ -99,18 +127,20 @@ export default function ImageBannerUnit({
isHorizontal && css.isHorizontalWrap
)}
>
{focusDown === true ? (
{rolling === true && focusDown === true ? (
<div
className={classNames(css.arrow, css.leftBtn)}
onClick={handlePrev}
></div>
) : (
) : rolling === true ? (
<SpottableComponent
className={classNames(css.arrow, css.leftBtn)}
onClick={handlePrev}
spotlightId={spotlightId + "Prev"}
></SpottableComponent>
)}
) : rolling === false ? (
<></>
) : null}
<SpottableComponent
className={classNames(css.itemBox, isHorizontal && css.isHorizontal)}
onClick={handleClick}
@@ -128,18 +158,20 @@ export default function ImageBannerUnit({
</p>
</SpottableComponent>
{focusDown === true ? (
{rolling === true && focusDown === true ? (
<div
className={classNames(css.arrow, css.rightBtn)}
onClick={handleNext}
onClick={handlePrev}
></div>
) : (
) : rolling === true ? (
<SpottableComponent
className={classNames(css.arrow, css.rightBtn)}
onClick={handleNext}
spotlightId={spotlightId + "Next"}
></SpottableComponent>
)}
) : rolling === false ? (
<></>
) : null}
</Container>
);
}

View File

@@ -169,7 +169,7 @@ export default function HomeTodayDeal({
) : rolling === true ? (
<SpottableComponent
className={classNames(css.arrow, css.rightBtn)}
onClick={handlePrev}
onClick={handleNext}
spotlightId={spotlightId + "Next"}
></SpottableComponent>
) : rolling === false ? (