[PlayerPanel] ShopNowContents add props paenelInfo
This commit is contained in:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user