[Player] FeaturedShowContents 클릭 이벤트 변경

This commit is contained in:
jangheon Pyo
2024-07-26 18:13:31 +09:00
parent 25cfb699de
commit f736ef74a8

View File

@@ -33,25 +33,6 @@ export default function FeaturedShowContents({
[handleItemFocus]
);
const handleItemClick = useCallback(
(index, patnrId, showId, lgCatCd) => () => {
setSelectedIndex(index + 1);
dispatch(
updatePanel({
name: panel_names.PLAYER_PANEL,
panelInfo: {
patnrId,
showId,
lgCatCd,
shptmBanrTpNm: "VOD",
isUpdatedByClick: true,
},
})
);
},
[dispatch, setSelectedIndex]
);
const renderItem = useCallback(
({ index, ...rest }) => {
const {
@@ -65,6 +46,27 @@ export default function FeaturedShowContents({
lgCatCd,
} = featuredShowsInfos[index];
const handleItemClick = () => {
if (currentVideoShowId && currentVideoShowId === showId) {
return;
}
setSelectedIndex(index + 1);
dispatch(
updatePanel({
name: panel_names.PLAYER_PANEL,
panelInfo: {
patnrId,
showId,
lgCatCd,
shptmBanrTpNm: "VOD",
isUpdatedByClick: true,
},
})
);
};
const showNameDangerouslySetInnerHTML = () => {
const sanitizedString = removeSpecificTags(showNm);
return { __html: sanitizedString };
@@ -79,10 +81,7 @@ export default function FeaturedShowContents({
imageSource={thumbnailUrl ? thumbnailUrl : defaultImage}
productName={showNameDangerouslySetInnerHTML}
patnerName={patncNm}
onClick={
currentVideoInfo.showId !== showId &&
handleItemClick(index, patnrId, showId, lgCatCd)
}
onClick={handleItemClick}
onFocus={handleFocus()}
type={TYPES.featuredHorizontal}
spotlightId={`tabChannel-video-${index}`}