change endOfServicePopUp location and logic

This commit is contained in:
hyunwoo93.cha
2024-08-08 17:42:03 +09:00
parent 0b4d619ee8
commit 9ea835adac
5 changed files with 21 additions and 25 deletions

View File

@@ -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() {

View File

@@ -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",

View File

@@ -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) && <EventPopUpBanner />}
{activePopup === ACTIVE_POPUP.endOfServicePopup &&
!skipEndOfServicePopup && <EndOfServicePopUp />}
</TPanel>
</>
);

View File

@@ -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 (
<div
className={classNames(css.mainViewWrap, className)}
@@ -667,6 +678,9 @@ export default function MainView({ className }) {
/>
) : null}
<SystemNotification />
{loadingComplete &&
activePopup === Config.ACTIVE_POPUP.endOfServicePopup &&
!skipEndOfServicePopup && <EndOfServicePopUp />}
</div>
);
}