diff --git a/com.twin.app.shoptime/src/App/deepLinkHandler.js b/com.twin.app.shoptime/src/App/deepLinkHandler.js index 93510c54..0e018bc4 100644 --- a/com.twin.app.shoptime/src/App/deepLinkHandler.js +++ b/com.twin.app.shoptime/src/App/deepLinkHandler.js @@ -1,6 +1,6 @@ -import { setSecondLayerInfo } from "../actions/commonActions"; +import { updateHomeInfo } from "../actions/homeActions"; import { pushPanel } from "../actions/panelActions"; -import { LOG_MENU, LOG_TP_NO, panel_names } from "../utils/Config"; +import { LOG_MENU, panel_names } from "../utils/Config"; //V2_진입경로코드_진입경로명_MT_노출순번 export const handleDeepLink = (contentTarget) => (dispatch, getState) => { @@ -229,17 +229,16 @@ export const handleDeepLink = (contentTarget) => (dispatch, getState) => { } if (panelName) { - console.log("handleDeepLink - panelName", panelName, panelInfo); + const action = + panelName === panel_names.HOME_PANEL ? updateHomeInfo : pushPanel; dispatch( - pushPanel({ + action({ name: panelName, panelInfo: { ...panelInfo, linkTpCd }, }) ); } - } else { - console.log("handleDeepLink - no target"); } } }; diff --git a/com.twin.app.shoptime/src/actions/actionTypes.js b/com.twin.app.shoptime/src/actions/actionTypes.js index 5e9dbb5d..0d84af25 100644 --- a/com.twin.app.shoptime/src/actions/actionTypes.js +++ b/com.twin.app.shoptime/src/actions/actionTypes.js @@ -59,11 +59,11 @@ export const types = { GET_THEME_HOTEL_DETAIL_INFO: "GET_THEME_HOTEL_DETAIL_INFO", GET_THEME_MENU_SHELF_INFO: "GET_THEME_MENU_SHELF_INFO", CLEAR_THEME_MENU_SHELF_INFO: "CLEAR_THEME_MENU_SHELF_INFO", - UPDATE_SPOTLIGHTID: "UPDATE_SPOTLIGHTID", CLEAR_THEME_DETAIL: "CLEAR_THEME_DETAIL", - SET_DEFAULT_FOCUS: "SET_DEFAULT_FOCUS", CHECK_ENTER_THROUGH_GNB: "CHECK_ENTER_THROUGH_GNB", + SET_DEFAULT_FOCUS: "SET_DEFAULT_FOCUS", SET_BANNER_INDEX: "SET_BANNER_INDEX", + UPDATE_HOME_INFO: "UPDATE_HOME_INFO", // brand actions GET_BRAND_LIST: "GET_BRAND_LIST", diff --git a/com.twin.app.shoptime/src/actions/homeActions.js b/com.twin.app.shoptime/src/actions/homeActions.js index 4ae00b3e..67f68e47 100644 --- a/com.twin.app.shoptime/src/actions/homeActions.js +++ b/com.twin.app.shoptime/src/actions/homeActions.js @@ -256,11 +256,10 @@ export const clearThemeMenuShelfInfo = () => ({ type: types.CLEAR_THEME_MENU_SHELF_INFO, }); -// 홈패널 스팟 아이디 저장용도 -export const updateSpotlightId = (currentSpot) => { +export const updateHomeInfo = (homeInfo) => { return { - type: types.UPDATE_SPOTLIGHTID, - payload: currentSpot, + type: types.UPDATE_HOME_INFO, + payload: homeInfo, }; }; diff --git a/com.twin.app.shoptime/src/actions/logActions.js b/com.twin.app.shoptime/src/actions/logActions.js index b0605ba9..6c2f238d 100644 --- a/com.twin.app.shoptime/src/actions/logActions.js +++ b/com.twin.app.shoptime/src/actions/logActions.js @@ -5,7 +5,6 @@ import { formatGMTString, getTimeDifferenceByMilliseconds, } from "../utils/helperMethods"; -import { types } from "./actionTypes"; import { setGNBMenu, setSecondLayerInfo } from "./commonActions"; export const getUrlByLogTpNo = (logTpNo) => { diff --git a/com.twin.app.shoptime/src/components/TabLayout/TabLayout.jsx b/com.twin.app.shoptime/src/components/TabLayout/TabLayout.jsx index 646c58b0..89a73f47 100644 --- a/com.twin.app.shoptime/src/components/TabLayout/TabLayout.jsx +++ b/com.twin.app.shoptime/src/components/TabLayout/TabLayout.jsx @@ -23,7 +23,7 @@ import shoptimeFullIcon from "../../../assets/images/icons/ic-lnb-logo-shoptime@ import { gnbOpened } from "../../actions/commonActions"; import { checkEnterThroughGNB, - updateSpotlightId, + updateHomeInfo, } from "../../actions/homeActions"; import { resetPanels } from "../../actions/panelActions"; import usePrevious from "../../hooks/usePrevious"; @@ -488,7 +488,7 @@ export default function TabLayout({ topPanelName, onTabActivated, panelInfo }) { dispatch(resetPanels()); dispatch(checkEnterThroughGNB(true)); dispatch( - updateSpotlightId({ + updateHomeInfo({ name: panel_names.HOME_PANEL, panelInfo: { currentSpot: null, @@ -510,7 +510,7 @@ export default function TabLayout({ topPanelName, onTabActivated, panelInfo }) { } dispatch( - updateSpotlightId({ + updateHomeInfo({ name: panel_names.HOME_PANEL, panelInfo: { currentSpot: null, @@ -540,7 +540,7 @@ export default function TabLayout({ topPanelName, onTabActivated, panelInfo }) { } dispatch( - updateSpotlightId({ + updateHomeInfo({ name: panel_names.HOME_PANEL, panelInfo: { currentSpot: null, diff --git a/com.twin.app.shoptime/src/reducers/homeReducer.js b/com.twin.app.shoptime/src/reducers/homeReducer.js index bd5dc06a..88e7e30f 100644 --- a/com.twin.app.shoptime/src/reducers/homeReducer.js +++ b/com.twin.app.shoptime/src/reducers/homeReducer.js @@ -18,6 +18,7 @@ const initialState = { themeCurationInfoDataCode: null, bannerIndices: {}, themeMenuShelfInfoData: null, + homeInfo: null, }; export const homeReducer = (state = initialState, action) => { @@ -120,10 +121,10 @@ export const homeReducer = (state = initialState, action) => { }; } - case types.UPDATE_SPOTLIGHTID: { + case types.UPDATE_HOME_INFO: { return { ...state, - spotData: action.payload, + homeInfo: action.payload, }; } case types.CLEAR_THEME_DETAIL: { diff --git a/com.twin.app.shoptime/src/views/HomePanel/HomePanel.jsx b/com.twin.app.shoptime/src/views/HomePanel/HomePanel.jsx index 670f03b0..ec4c1b18 100644 --- a/com.twin.app.shoptime/src/views/HomePanel/HomePanel.jsx +++ b/com.twin.app.shoptime/src/views/HomePanel/HomePanel.jsx @@ -27,7 +27,7 @@ import { checkEnterThroughGNB, getHomeLayout, getHomeMainContents, - updateSpotlightId, + updateHomeInfo, } from "../../actions/homeActions"; import { sendLogGNB } from "../../actions/logActions"; import { getSubCategory, getTop20Show } from "../../actions/mainActions"; @@ -68,7 +68,7 @@ export default function HomePanel({ isOnTop }) { const isGnbOpened = useSelector((state) => state.common.isGnbOpened); const homeLayoutInfo = useSelector((state) => state.home.layoutData); const panelInfo = useSelector( - (state) => state.home.spotData?.panelInfo ?? {} + (state) => state.home.homeInfo?.panelInfo ?? {} ); const panels = useSelector((state) => state.panels.panels); const webOSVersion = useSelector( @@ -124,7 +124,7 @@ export default function HomePanel({ isOnTop }) { const isInitialRender = useRef(true); const verticalPagenatorRef = useRef(null); - const sendedNowMenuRef = useRef(null); + const currentSentMenuRef = useRef(null); const sortedHomeLayoutInfo = useMemo(() => { if (homeLayoutInfo && homeLayoutInfo.homeLayoutInfo) { @@ -160,7 +160,7 @@ export default function HomePanel({ isOnTop }) { return; } dispatch( - updateSpotlightId({ + updateHomeInfo({ name: panel_names.HOME_PANEL, panelInfo: { currentSpot: currentSpot, @@ -205,7 +205,7 @@ export default function HomePanel({ isOnTop }) { const doSendLogGNB = useCallback( (containerId) => { - let nowMenu = null; + let nowMenu; switch (containerId) { case TEMPLATE_CODE_CONF.TOP: nowMenu = LOG_MENU.HOME_TOP; @@ -222,10 +222,13 @@ export default function HomePanel({ isOnTop }) { case TEMPLATE_CODE_CONF.BEST_SELLER: nowMenu = LOG_MENU.HOME_BEST_SELLER; break; + default: + nowMenu = LOG_MENU.HOME_TOP; + break; } - if (nowMenu && nowMenu !== sendedNowMenuRef.current) { + if (nowMenu && nowMenu !== currentSentMenuRef.current) { dispatch(sendLogGNB(nowMenu)); - sendedNowMenuRef.current = nowMenu; + currentSentMenuRef.current = nowMenu; } }, [pageSpotIds] @@ -507,7 +510,7 @@ export default function HomePanel({ isOnTop }) { dispatch(checkEnterThroughGNB(false)); dispatch( - updateSpotlightId({ + updateHomeInfo({ name: panel_names.HOME_PANEL, panelInfo: { currentSpot: currentSpot,