[Log] modify, IF-LGSP-LOG-003 (sendLogCuration)
Detail Note: 1. modify, "getMenuData" func in TabLayout.jsx (add expsOrd) 2. modify, useEffect for "sendLogCuration" in CategoryPanel.jsx
This commit is contained in:
@@ -188,6 +188,7 @@ export default function TabLayout({ topPanelName, onTabActivated, panelInfo }) {
|
||||
dropDownTab: 0,
|
||||
tab: 0,
|
||||
focusedContainerId: null,
|
||||
expsOrd: item?.expsOrd,
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -94,6 +94,7 @@ const CategoryPanel = ({ panelInfo, isOnTop, spotlightId }) => {
|
||||
const logTimerRef = useRef(null);
|
||||
const topPanel = panels[panels.length - 1];
|
||||
const [targetId, setTargetId] = useState(null);
|
||||
const [isSendedLogGNBExcuted, setIsSendedLogGNBExcuted] = useState(false);
|
||||
|
||||
const timerRef = useRef();
|
||||
|
||||
@@ -133,27 +134,40 @@ const CategoryPanel = ({ panelInfo, isOnTop, spotlightId }) => {
|
||||
}
|
||||
if (nowMenu) {
|
||||
dispatch(sendLogGNB(nowMenu));
|
||||
setIsSendedLogGNBExcuted(true);
|
||||
}
|
||||
}, [categoryItemInfos, categoryShowInfos, tab]);
|
||||
|
||||
useEffect(() => {
|
||||
const cnttTpNm = tab === 0 ? "Show" : "Item";
|
||||
const sortTpNm = dropDownTab === 0 ? "New" : "Popular";
|
||||
if (isSendedLogGNBExcuted) {
|
||||
const cnttTpNm = tab === 0 ? "Show" : "Item";
|
||||
const sortTpNm = dropDownTab === 0 ? "New" : "Popular";
|
||||
|
||||
logTimerRef.current = setTimeout(() => {
|
||||
dispatch(
|
||||
sendLogCuration({
|
||||
cnttTpNm,
|
||||
lgCatCd,
|
||||
lgCatNm,
|
||||
logTpNo: LOG_TP_NO.CURATION.CATEGORY,
|
||||
sortTpNm,
|
||||
})
|
||||
);
|
||||
}, 300);
|
||||
logTimerRef.current = setTimeout(() => {
|
||||
dispatch(
|
||||
sendLogCuration({
|
||||
cnttTpNm,
|
||||
expsOrd: `${panelInfo?.expsOrd}`,
|
||||
lgCatCd,
|
||||
lgCatNm,
|
||||
linkTpCd: panelInfo?.linkTpCd,
|
||||
logTpNo: LOG_TP_NO.CURATION.CATEGORY,
|
||||
sortTpNm,
|
||||
})
|
||||
);
|
||||
}, 300);
|
||||
|
||||
return () => clearTimeout(logTimerRef.current);
|
||||
}, [dropDownTab, lgCatCd, lgCatNm, tab]);
|
||||
return () => clearTimeout(logTimerRef.current);
|
||||
}
|
||||
}, [
|
||||
dropDownTab,
|
||||
isSendedLogGNBExcuted,
|
||||
lgCatCd,
|
||||
lgCatNm,
|
||||
panelInfo?.expsOrd,
|
||||
panelInfo?.linkTpCd,
|
||||
tab,
|
||||
]);
|
||||
|
||||
const reload = useCallback(() => {
|
||||
const tabType = tabRef.current === 0 ? "CAT00101" : "CAT00102";
|
||||
|
||||
Reference in New Issue
Block a user