Home에서 PopularShow 진입 후 BestSeller를 나갔다오면 video 포커스 후 다시 ItemCard로 진입하는 현상 수정

This commit is contained in:
dongyoungKo
2025-05-14 11:00:32 +09:00
parent a70c749425
commit 2cf04c43a7
2 changed files with 63 additions and 86 deletions

View File

@@ -63,22 +63,6 @@ const PopularShow = ({
const handleCardClick = useCallback(
(patnrId, showId, catCd, showUrl) => () => {
const lastFocusedTargetId = getContainerId(Spotlight.getCurrent());
const currentSpot = Spotlight.getCurrent();
if (lastFocusedTargetId) {
dispatch(
updateHomeInfo({
name: panel_names.HOME_PANEL,
panelInfo: {
lastFocusedTargetId,
focusedContainerId: TEMPLATE_CODE_CONF.POPULAR_SHOW,
currentSpot: currentSpot?.getAttribute("data-spotlight-id"),
},
})
);
}
dispatch(
startVideoPlayer({
showId,

View File

@@ -4,70 +4,63 @@ import React, {
useLayoutEffect,
useMemo,
useRef,
} from 'react';
} from "react";
import classNames from 'classnames';
import { useDispatch } from 'react-redux';
import classNames from "classnames";
import { useDispatch } from "react-redux";
import { Job } from '@enact/core/util';
import Spotlight from '@enact/spotlight';
import SpotlightContainerDecorator
from '@enact/spotlight/SpotlightContainerDecorator';
import { setContainerLastFocusedElement } from '@enact/spotlight/src/container';
import { Job } from "@enact/core/util";
import Spotlight from "@enact/spotlight";
import SpotlightContainerDecorator from "@enact/spotlight/SpotlightContainerDecorator";
import { setContainerLastFocusedElement } from "@enact/spotlight/src/container";
import dummyVtt from '../../../assets/mock/video.vtt';
import dummyVtt from "../../../assets/mock/video.vtt";
import {
changeAppStatus,
changeLocalSettings,
requestLiveSubtitle,
sendBroadCast,
setHidePopup,
} from '../../actions/commonActions';
} from "../../actions/commonActions";
import {
sendLogGNB,
sendLogLive,
sendLogTotalRecommend,
sendLogVOD,
} from '../../actions/logActions';
} from "../../actions/logActions";
import {
clearShopNowInfo,
getHomeFullVideoInfo,
getMainCategoryShowDetail,
getMainLiveShow,
getMainLiveShowNowProduct,
} from '../../actions/mainActions';
import * as PanelActions from '../../actions/panelActions';
import { updatePanel } from '../../actions/panelActions';
} from "../../actions/mainActions";
import * as PanelActions from "../../actions/panelActions";
import { updatePanel } from "../../actions/panelActions";
import {
CLEAR_PLAYER_INFO,
getChatLog,
getSubTitle,
startVideoPlayer,
} from '../../actions/playActions';
import { convertUtcToLocal } from '../../components/MediaPlayer/util';
import TPanel from '../../components/TPanel/TPanel';
import TPopUp from '../../components/TPopUp/TPopUp';
import Media from '../../components/VideoPlayer/Media';
import TReactPlayer from '../../components/VideoPlayer/TReactPlayer';
import { VideoPlayer } from '../../components/VideoPlayer/VideoPlayer';
import usePrevious from '../../hooks/usePrevious';
import useWhyDidYouUpdate from '../../hooks/useWhyDidYouUpdate';
import * as Config from '../../utils/Config';
import {
ACTIVE_POPUP,
panel_names,
} from '../../utils/Config';
import {
$L,
formatGMTString,
} from '../../utils/helperMethods';
import { SpotlightIds } from '../../utils/SpotlightIds';
import { removeDotAndColon } from './PlayerItemCard/PlayerItemCard';
import PlayerOverlayChat from './PlayerOverlay/PlayerOverlayChat';
import PlayerOverlayQRCode from './PlayerOverlay/PlayerOverlayQRCode';
import css from './PlayerPanel.module.less';
import PlayerTabButton from './PlayerTabContents/TabButton/PlayerTabButton';
import TabContainer from './PlayerTabContents/TabContainer';
} from "../../actions/playActions";
import { convertUtcToLocal } from "../../components/MediaPlayer/util";
import TPanel from "../../components/TPanel/TPanel";
import TPopUp from "../../components/TPopUp/TPopUp";
import Media from "../../components/VideoPlayer/Media";
import TReactPlayer from "../../components/VideoPlayer/TReactPlayer";
import { VideoPlayer } from "../../components/VideoPlayer/VideoPlayer";
import usePrevious from "../../hooks/usePrevious";
import useWhyDidYouUpdate from "../../hooks/useWhyDidYouUpdate";
import * as Config from "../../utils/Config";
import { ACTIVE_POPUP, panel_names } from "../../utils/Config";
import { $L, formatGMTString } from "../../utils/helperMethods";
import { SpotlightIds } from "../../utils/SpotlightIds";
import { removeDotAndColon } from "./PlayerItemCard/PlayerItemCard";
import PlayerOverlayChat from "./PlayerOverlay/PlayerOverlayChat";
import PlayerOverlayQRCode from "./PlayerOverlay/PlayerOverlayQRCode";
import css from "./PlayerPanel.module.less";
import PlayerTabButton from "./PlayerTabContents/TabButton/PlayerTabButton";
import TabContainer from "./PlayerTabContents/TabContainer";
const Container = SpotlightContainerDecorator(
{ enterTo: "default-element", preserveld: true },
@@ -234,7 +227,6 @@ const PlayerPanel = ({
const panels = USE_SELECTOR("panels", (state) => state.panels.panels);
const chatData = USE_SELECTOR("chatData", (state) => state.play.chatData);
const popupVisible = USE_SELECTOR(
"popupVisible",
(state) => state.common.popup.popupVisible
@@ -891,7 +883,9 @@ const PlayerPanel = ({
//딮링크로 플레이어 진입 후 이전버튼 클릭시
if (panels.length === 1) {
Spotlight.focus(SpotlightIds.HOME_TBODY);
setTimeout(() => {
Spotlight.focus(SpotlightIds.HOME_TBODY);
});
}
ev?.stopPropagation();
// ev?.preventDefault();
@@ -1013,7 +1007,6 @@ const PlayerPanel = ({
panelInfo.isUpdatedByClick,
panelInfo.isIndicatorByClick,
panelInfo.shptmBanrTpNm,
]);
@@ -1984,44 +1977,45 @@ const PlayerPanel = ({
const isPlayer = useMemo(() => {
if (!panelInfo.modal) {
return 'full player';
return "full player";
}
switch (panels[0].name) {
case 'categorypanel':
return 'category';
case 'mypagepanel':
return 'my page';
case 'searchpanel':
return 'search';
case 'hotpickpanel':
return 'hot picks';
case 'featuredbrandspanel':
return 'featured brands';
case 'trendingnowpanel':
return 'trending now';
case 'playerpanel':
return 'home';
case "categorypanel":
return "category";
case "mypagepanel":
return "my page";
case "searchpanel":
return "search";
case "hotpickpanel":
return "hot picks";
case "featuredbrandspanel":
return "featured brands";
case "trendingnowpanel":
return "trending now";
case "playerpanel":
return "home";
}
}, [panelInfo.modal, panels]);
useEffect(() => {
if (!panelInfo?.shptmBanrTpNm) return;
const brandArray = showDetailInfo?.[0]?.productInfos?.map(item => item.brndNm) || [];
const categoryArray = showDetailInfo?.[0]?.productInfos?.map(item => item.catNm) || [];
const brandArray =
showDetailInfo?.[0]?.productInfos?.map((item) => item.brndNm) || [];
const categoryArray =
showDetailInfo?.[0]?.productInfos?.map((item) => item.catNm) || [];
const params = {
visible: 'true',
visible: "true",
showType: panelInfo.shptmBanrTpNm,
player: isPlayer,
contentId: showDetailInfo?.[0]?.showId || '',
contentTitle: showDetailInfo?.[0]?.showNm || '',
partner: showDetailInfo?.[0]?.patncNm || '',
brand: brandArray.join('|') || null,
category: categoryArray.join('|') || null,
contentId: showDetailInfo?.[0]?.showId || "",
contentTitle: showDetailInfo?.[0]?.showNm || "",
partner: showDetailInfo?.[0]?.patncNm || "",
brand: brandArray.join("|") || null,
category: categoryArray.join("|") || null,
contextName: Config.LOG_CONTEXT_NAME.SHOW,
messageId: Config.LOG_MESSAGE_ID.SHOWVIEW
messageId: Config.LOG_MESSAGE_ID.SHOWVIEW,
};
dispatch(sendLogTotalRecommend(params));
@@ -2029,11 +2023,10 @@ const PlayerPanel = ({
return () => {
const unmountParams = {
...params,
visible: 'false'
visible: "false",
};
dispatch(sendLogTotalRecommend(unmountParams));
};
}, [panelInfo?.shptmBanrTpNm, isPlayer]);
return (