youmaylike API 호출 변경

This commit is contained in:
고동영
2024-08-28 15:01:01 +09:00
parent b157055931
commit e58bb2cd6c
2 changed files with 31 additions and 30 deletions

View File

@@ -22,7 +22,10 @@ import {
getThemeCurationDetailInfo,
getThemeHotelDetailInfo,
} from "../../actions/homeActions";
import { getMainCategoryDetail } from "../../actions/mainActions";
import {
getMainCategoryDetail,
getMainYouMayLike,
} from "../../actions/mainActions";
import { popPanel } from "../../actions/panelActions";
import { finishVideoPreview } from "../../actions/playActions";
import {
@@ -129,6 +132,17 @@ export default function DetailPanel({ panelInfo, isOnTop, spotlightId }) {
panelInfo.patnrId,
]);
useEffect(() => {
dispatch(
getMainYouMayLike({
lgCatCd: lgCatCd,
exclCurationId: panelInfo?.curationId,
exclPatnrId: panelInfo?.patnrId,
exclPrdtId: panelInfo?.prdtId,
})
);
}, [panelInfo?.curationId, panelInfo?.patnrId, panelInfo?.prdtId, lgCatCd]);
useEffect(() => {
if (productData?.pmtSuptYn === "Y" && productData?.grPrdtProcYn === "Y") {
dispatch(
@@ -460,18 +474,14 @@ export default function DetailPanel({ panelInfo, isOnTop, spotlightId }) {
)}
</TBody>
</TPanel>
{lgCatCd && (productData || themeProductInfos) && youmaylikeData && (
{lgCatCd && (productData || themeProductInfos) && (
<YouMayLike
isUnable={
productData?.pmtSuptYn === "N" ||
panelInfo?.type === "hotel" ||
panelInfo?.type === "theme"
}
lgCatCd={lgCatCd}
panelInfo={panelInfo}
selectedCurationId={panelInfo?.curationId}
selectedPatnrId={panelInfo?.patnrId}
selectedPrdtId={panelInfo?.prdtId}
setSelectedIndex={setSelectedIndex}
productInfo={productData || themeData}
setIsYouMayLikeOpened={setIsYouMayLikeOpened}

View File

@@ -36,12 +36,9 @@ const Container = SpotlightContainerDecorator(
const SpottableComponent = Spottable("div");
export default memo(function YouMayLike({
isUnable,
lgCatCd,
panelInfo,
productInfo,
selectedPatnrId,
selectedPrdtId,
selectedCurationId,
setSelectedIndex,
setIsYouMayLikeOpened,
}) {
@@ -79,16 +76,8 @@ export default memo(function YouMayLike({
}, [expanded, setIsYouMayLikeOpened]);
useEffect(() => {
dispatch(
getMainYouMayLike({
lgCatCd: lgCatCd,
exclCurationId: selectedCurationId,
exclPatnrId: selectedPatnrId,
exclPrdtId: selectedPrdtId,
})
);
scrollLeft();
}, [dispatch, lgCatCd, panelInfo]);
}, [panelInfo]);
const cursorVisibleOnFocus = useCallback(() => {
if (cursorVisible) {
@@ -207,17 +196,19 @@ export default memo(function YouMayLike({
<span className={classNames(css.arrow, expanded && css.expanded)} />
</SpottableComponent>
<Container className={css.itemWrap}>
<TVirtualGridList
cbScrollTo={getScrollTo}
dataSize={youmaylikeData.length}
direction="horizontal"
autoScroll
renderItem={renderItem}
itemWidth={324}
itemHeight={438}
spacing={15}
className={css.itemList}
/>
{youmaylikeData && youmaylikeData.length > 0 && (
<TVirtualGridList
cbScrollTo={getScrollTo}
dataSize={youmaylikeData.length}
direction="horizontal"
autoScroll
renderItem={renderItem}
itemWidth={324}
itemHeight={438}
spacing={15}
className={css.itemList}
/>
)}
</Container>
{expanded && (
<Container className={css.extraArea} onClick={onClickExtraArea} />