[HotPicksPanel] modify, log logic
This commit is contained in:
@@ -26,6 +26,11 @@ import {
|
||||
} from "../../actions/couponActions";
|
||||
import { setEventIssueReq } from "../../actions/eventActions";
|
||||
import { getThemeCurationInfo } from "../../actions/homeActions";
|
||||
import {
|
||||
sendLogCuration,
|
||||
sendLogGNB,
|
||||
sendLogShopByMobile,
|
||||
} from "../../actions/logActions";
|
||||
import {
|
||||
popPanel,
|
||||
pushPanel,
|
||||
@@ -57,7 +62,6 @@ import TCFV_2 from "./Type/TCFV_2/TCFV_2";
|
||||
import TCFV_3 from "./Type/TCFV_3/TCFV_3";
|
||||
import TCFV_4 from "./Type/TCFV_4/TCFV_4";
|
||||
import TCHH from "./Type/TCHH/TCHH";
|
||||
import { sendLogCuration, sendLogGNB, sendLogShopByMobile } from "../../actions/logActions";
|
||||
|
||||
const SpottableComponent = Spottable("button");
|
||||
|
||||
@@ -224,6 +228,7 @@ const HotPicksPanel = ({ panelInfo, isOnTop, spotlightId }) => {
|
||||
|
||||
const handleTopButtonClick = () => {
|
||||
setCurrentPage(0);
|
||||
setOneLog(false);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
@@ -287,6 +292,7 @@ const HotPicksPanel = ({ panelInfo, isOnTop, spotlightId }) => {
|
||||
if (themeCurationInfoData) {
|
||||
const { curationId, curationNm, expsOrd, patncNm, patnrId } =
|
||||
themeCurationInfoData[currentPage];
|
||||
|
||||
if (panelInfo?.linkTpCd) {
|
||||
//딥링크 탈때
|
||||
let matchData = themeCurationInfoData.filter(
|
||||
@@ -318,6 +324,7 @@ const HotPicksPanel = ({ panelInfo, isOnTop, spotlightId }) => {
|
||||
patnrId: patnrId,
|
||||
};
|
||||
}
|
||||
|
||||
if (!oneLog) {
|
||||
// if (expsOrdRef.current !== expsOrd) {
|
||||
timer = setTimeout(() => {
|
||||
@@ -329,13 +336,14 @@ const HotPicksPanel = ({ panelInfo, isOnTop, spotlightId }) => {
|
||||
return () => clearTimeout(timer);
|
||||
// }
|
||||
}
|
||||
|
||||
if (panelInfo?.linkTpCd) {
|
||||
dispatch(resetPanels([{ name: panel_names.HOT_PICKS_PANEL }]));
|
||||
dispatch(
|
||||
updatePanel({
|
||||
name: panel_names.HOT_PICKS_PANEL,
|
||||
panelInfo: {
|
||||
curationId: saveCuration,
|
||||
linkTpCd: null,
|
||||
patnrId: savePatnrId,
|
||||
},
|
||||
})
|
||||
@@ -799,21 +807,22 @@ const HotPicksPanel = ({ panelInfo, isOnTop, spotlightId }) => {
|
||||
)}
|
||||
</TPanel>
|
||||
);
|
||||
}
|
||||
};
|
||||
const propsAreEqual = (prev, next) => {
|
||||
const keys = Object.keys(prev);
|
||||
const nextKeys = Object.keys(next);
|
||||
if(!next.isOnTop){ //ignore event on background
|
||||
if (!next.isOnTop) {
|
||||
//ignore event on background
|
||||
return true;
|
||||
}
|
||||
if(keys.length !== nextKeys.length){
|
||||
if (keys.length !== nextKeys.length) {
|
||||
return false;
|
||||
}
|
||||
for(let i=0; i<keys.length; i++){
|
||||
if(prev[keys[i]] !== next[keys[i]]){
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
if (prev[keys[i]] !== next[keys[i]]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
export default React.memo(HotPicksPanel, propsAreEqual);
|
||||
};
|
||||
export default React.memo(HotPicksPanel, propsAreEqual);
|
||||
|
||||
Reference in New Issue
Block a user