[PlayerPanel] ShopNowContents add props paenelInfo

This commit is contained in:
고동영
2024-08-02 16:55:19 +09:00
parent aa60c69225
commit dcef452600

View File

@@ -34,26 +34,28 @@ export default function ShopNowContents({
playListInfo,
tabIndex,
handleItemFocus,
panelInfo,
}) {
const { getScrollTo, scrollTop } = useScrollTo();
const dispatch = useDispatch();
const panelInfo = useSelector((state) => state.panels.panels[1]?.panelInfo);
const paenls = useSelector((state) => state.panels.panels[1]?.panelInfo);
const scrollTopJob = useRef(new Job((func) => func(), 0));
const [height, setHeight] = useState();
const gridStyle = useMemo(() => ({ height: `${height}px` }), [height]);
useEffect(() => {
if (!panelInfo?.y) {
if (!paenls?.y) {
return;
}
const scrollTopJobValue = scrollTopJob.current;
const { y } = panelInfo;
const { y } = paenls;
scrollTopJobValue.start(() => scrollTop({ y, animate: false }));
return () => scrollTopJobValue.stop();
}, [panelInfo, scrollTop]);
}, [paenls, scrollTop]);
useEffect(() => {
if (shopNowInfo && shopNowInfo.length < 3) {
@@ -92,7 +94,7 @@ export default function ShopNowContents({
showNm: playListInfo?.showNm,
showId: playListInfo?.showId,
liveFlag: playListInfo?.liveFlag,
liveReqFlag: panelInfo?.shptmBanrTpN === "LIVE" && "Y",
liveReqFlag: panelInfo?.shptmBanrTpNm === "LIVE" && "Y",
patnrId,
prdtId,
launchedFromPlayer: true,
@@ -118,7 +120,7 @@ export default function ShopNowContents({
/>
);
},
[shopNowInfo, videoVerticalVisible]
[shopNowInfo, videoVerticalVisible, panelInfo?.shptmBanrTpNm]
);
return (