From 9ea835adacffe5a9ea3c64326a824b9832a7b600 Mon Sep 17 00:00:00 2001 From: "hyunwoo93.cha" Date: Thu, 8 Aug 2024 17:42:03 +0900 Subject: [PATCH] change endOfServicePopUp location and logic --- .../EndOfServicePopUp/EndOfServicePopUp.jsx | 9 +++------ .../EndOfServicePopUp.module.less | 0 com.twin.app.shoptime/src/lunaSend/common.js | 2 +- .../src/views/HomePanel/HomePanel.jsx | 17 +---------------- .../src/views/MainView/MainView.jsx | 18 ++++++++++++++++-- 5 files changed, 21 insertions(+), 25 deletions(-) rename com.twin.app.shoptime/src/{views/HomePanel => components}/EndOfServicePopUp/EndOfServicePopUp.jsx (89%) rename com.twin.app.shoptime/src/{views/HomePanel => components}/EndOfServicePopUp/EndOfServicePopUp.module.less (100%) diff --git a/com.twin.app.shoptime/src/views/HomePanel/EndOfServicePopUp/EndOfServicePopUp.jsx b/com.twin.app.shoptime/src/components/EndOfServicePopUp/EndOfServicePopUp.jsx similarity index 89% rename from com.twin.app.shoptime/src/views/HomePanel/EndOfServicePopUp/EndOfServicePopUp.jsx rename to com.twin.app.shoptime/src/components/EndOfServicePopUp/EndOfServicePopUp.jsx index 56401323..fa34b039 100644 --- a/com.twin.app.shoptime/src/views/HomePanel/EndOfServicePopUp/EndOfServicePopUp.jsx +++ b/com.twin.app.shoptime/src/components/EndOfServicePopUp/EndOfServicePopUp.jsx @@ -2,12 +2,9 @@ import React, { useCallback, useEffect } from "react"; import { useDispatch, useSelector } from "react-redux"; -import { - changeLocalSettings, - setHidePopup, -} from "../../../actions/commonActions"; -import TPopUp from "../../../components/TPopUp/TPopUp"; -import { $L } from "../../../utils/helperMethods"; +import { changeLocalSettings, setHidePopup } from "../../actions/commonActions"; +import { $L } from "../../utils/helperMethods"; +import TPopUp from "../TPopUp/TPopUp"; import css from "./EndOfServicePopUp.module.less"; export default function EndOfServicePopUp() { diff --git a/com.twin.app.shoptime/src/views/HomePanel/EndOfServicePopUp/EndOfServicePopUp.module.less b/com.twin.app.shoptime/src/components/EndOfServicePopUp/EndOfServicePopUp.module.less similarity index 100% rename from com.twin.app.shoptime/src/views/HomePanel/EndOfServicePopUp/EndOfServicePopUp.module.less rename to com.twin.app.shoptime/src/components/EndOfServicePopUp/EndOfServicePopUp.module.less diff --git a/com.twin.app.shoptime/src/lunaSend/common.js b/com.twin.app.shoptime/src/lunaSend/common.js index a2d7cc25..288be2ec 100644 --- a/com.twin.app.shoptime/src/lunaSend/common.js +++ b/com.twin.app.shoptime/src/lunaSend/common.js @@ -80,7 +80,7 @@ export const getHttpHeaderForServiceRequest = ({ "X-Device-Eco-Info": "1", "X-Device-Country": "US", "X-Device-Language": "en-US", - "X-Device-Netcast-Platform-Version": "6.4.0", + "X-Device-Netcast-Platform-Version": "3.4.0", "X-Device-Publish-Flag": "N", "X-Device-Fck": "253", "X-Device-SDK-VERSION": "1.0.0", diff --git a/com.twin.app.shoptime/src/views/HomePanel/HomePanel.jsx b/com.twin.app.shoptime/src/views/HomePanel/HomePanel.jsx index fa2ba2aa..594b9421 100644 --- a/com.twin.app.shoptime/src/views/HomePanel/HomePanel.jsx +++ b/com.twin.app.shoptime/src/views/HomePanel/HomePanel.jsx @@ -28,10 +28,7 @@ import { import { sendLogGNB } from "../../actions/logActions"; import { getSubCategory, getTop20Show } from "../../actions/mainActions"; import { getHomeOnSaleInfo } from "../../actions/onSaleActions"; -import { - finishVideoPreview, - startVideoPlayer, -} from "../../actions/playActions"; +import { finishVideoPreview } from "../../actions/playActions"; import { getBestSeller } from "../../actions/productActions"; import TBody from "../../components/TBody/TBody"; import TButton, { TYPES } from "../../components/TButton/TButton"; @@ -49,7 +46,6 @@ import HomeOnSale from "../HomePanel/HomeOnSale/HomeOnSale"; import css from "../HomePanel/HomePanel.module.less"; import PopularShow from "../HomePanel/PopularShow/PopularShow"; import SubCategory from "../HomePanel/SubCategory/SubCategory"; -import EndOfServicePopUp from "./EndOfServicePopUp/EndOfServicePopUp"; import EventPopUpBanner from "./EventPopUpBanner/EventPopUpBanner"; const TEMPLATE_CODE_CONF = { @@ -106,9 +102,6 @@ export default function HomePanel({ isOnTop }) { const isDeepLink = useSelector( (state) => state.common.deepLinkInfo.isDeepLink ); - const skipEndOfServicePopup = useSelector( - (state) => state.localSettings.skipEndOfServicePopup - ); const [btnDisabled, setBtnDisabled] = useState(true); const [arrowBottom, setArrowBottom] = useState(true); @@ -458,12 +451,6 @@ export default function HomePanel({ isOnTop }) { [webOSVersion] ); - useEffect(() => { - if (webOSVersion && Number(webOSVersion) < 4 && !skipEndOfServicePopup) { - dispatch(setShowPopup(ACTIVE_POPUP.endOfServicePopup)); - } - }, [dispatch, skipEndOfServicePopup, webOSVersion]); - useEffect(() => { if (Object.keys(eventData).length >= 1) { if (eventPopInfosData && eventClickSuccess === null) { @@ -572,8 +559,6 @@ export default function HomePanel({ isOnTop }) { )} {(activePopup === ACTIVE_POPUP.eventPopup || activePopup === ACTIVE_POPUP.smsPopup) && } - {activePopup === ACTIVE_POPUP.endOfServicePopup && - !skipEndOfServicePopup && } ); diff --git a/com.twin.app.shoptime/src/views/MainView/MainView.jsx b/com.twin.app.shoptime/src/views/MainView/MainView.jsx index b33c4345..cab2ee36 100644 --- a/com.twin.app.shoptime/src/views/MainView/MainView.jsx +++ b/com.twin.app.shoptime/src/views/MainView/MainView.jsx @@ -41,6 +41,7 @@ import { setMyTermsWithdraw, } from "../../actions/myPageActions"; import { pushPanel, resetPanels } from "../../actions/panelActions"; +import EndOfServicePopUp from "../../components/EndOfServicePopUp/EndOfServicePopUp"; import Loader from "../../components/Loader/Loader"; import { convertUtcToLocal } from "../../components/MediaPlayer/util"; import PreloadImage from "../../components/PreloadImage/PreloadImage"; @@ -133,8 +134,10 @@ export default function MainView({ className }) { activePopup, data: errorCode, } = useSelector((state) => state.common.popup); - const { showLoadingPanel, toast, toastText, isLoading } = useSelector( - (state) => state.common.appStatus + const { showLoadingPanel, toast, toastText, isLoading, webOSVersion } = + useSelector((state) => state.common.appStatus); + const skipEndOfServicePopup = useSelector( + (state) => state.localSettings.skipEndOfServicePopup ); const deviceCountryCode = httpHeader?.["X-Device-Country"] || ""; @@ -144,6 +147,7 @@ export default function MainView({ className }) { const [tabActivated, setTabActivated] = useState(false); const [imagePreloaded, setImagePreloaded] = useState(false); const [ariaHidden, setAriaHidden] = useState(false); + const [showEndOfServicePopup, setShowEndOfServicePopup] = useState(false); const appStatus = useSelector((state) => state.common.appStatus); const isHomeOnTop = useMemo(() => { @@ -573,6 +577,13 @@ export default function MainView({ className }) { } }, [deviceCountryCode]); + useEffect(() => { + if (webOSVersion && Number(webOSVersion) < 4 && !skipEndOfServicePopup) { + setShowEndOfServicePopup(true); + dispatch(setShowPopup(Config.ACTIVE_POPUP.endOfServicePopup)); + } + }, [webOSVersion]); + return (
) : null} + {loadingComplete && + activePopup === Config.ACTIVE_POPUP.endOfServicePopup && + !skipEndOfServicePopup && }
); }