diff --git a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/v2/TabContainer.v2.jsx b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/v2/TabContainer.v2.jsx index d4cdce8b..8c2be7a6 100644 --- a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/v2/TabContainer.v2.jsx +++ b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/v2/TabContainer.v2.jsx @@ -7,27 +7,28 @@ import Spotlight from '@enact/spotlight'; import SpotlightContainerDecorator from '@enact/spotlight/SpotlightContainerDecorator'; import Spottable from '@enact/spotlight/Spottable'; +// import icon_arrow_right from '../../../../../assets/images/icons'; +import icon_arrow_dwon from '../../../../../assets/images/player/icon_tabcontainer_arrow_down.png'; +import usePrevious from '../../../../hooks/usePrevious'; +import { LOG_MENU } from '../../../../utils/Config'; import { createDebugHelpers } from '../../../../utils/debug'; +import { $L } from '../../../../utils/helperMethods'; +import { SpotlightIds } from '../../../../utils/SpotlightIds'; +import FeaturedShowContents from '../TabContents/FeaturedShowContents'; +import LiveChannelContents from '../TabContents/LiveChannelContents'; +import ShopNowContents from '../TabContents/ShopNowContents'; +import LiveChannelNext from './LiveChannelNext'; +import ShopNowButton from './ShopNowButton'; +import css from './TabContainer.v2.module.less'; // 디버그 헬퍼 설정 const DEBUG_MODE = false; const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE); -// import icon_arrow_right from '../../../../../assets/images/icons'; -import icon_arrow_dwon from '../../../../../assets/images/player/icon_tabcontainer_arrow_down.png'; -import icon_shop_now from '../../../../../assets/images/player/icon_tabcontainer_shopnow.png'; -import { LOG_MENU } from '../../../../utils/Config'; -import { $L } from '../../../../utils/helperMethods'; -import { SpotlightIds } from '../../../../utils/SpotlightIds'; -import usePrevious from '../../../../hooks/usePrevious'; -import LiveChannelContents from '../TabContents/LiveChannelContents'; -import FeaturedShowContents from '../TabContents/FeaturedShowContents'; -import ShopNowContents from '../TabContents/ShopNowContents'; -import ShopNowButton from './ShopNowButton'; -import LiveChannelNext from './LiveChannelNext'; -import css from './TabContainer.v2.module.less'; - -const Container = SpotlightContainerDecorator({ enterTo: 'last-focused' }, 'div'); +const Container = SpotlightContainerDecorator( + { enterTo: 'last-focused' }, + 'div' +); const SpottableDiv = Spottable('div'); @@ -50,18 +51,22 @@ export default function TabContainerV2({ onTabClose, // 탭 닫기 콜백 함수 tabVisible, }) { - const youmaylikeInfos = useSelector((state) => state.main.youmaylikeInfos); + const youmaylikeInfos = useSelector((state) => state.main.youmaylikeInfos); // 다음 재생 가능한 쇼 찾기 const findNextPlayableShow = useCallback((currentPlayList, currentIndex) => { if (!currentPlayList || currentPlayList.length === 0) return null; - let nextIndex = currentIndex === currentPlayList.length - 1 ? 0 : currentIndex + 1; + let nextIndex = + currentIndex === currentPlayList.length - 1 ? 0 : currentIndex + 1; let initialIndex = nextIndex; let attempts = 0; // 유효한 showId를 가진 다음 쇼 찾기 - while (!currentPlayList[nextIndex]?.showId && attempts < currentPlayList.length) { + while ( + !currentPlayList[nextIndex]?.showId && + attempts < currentPlayList.length + ) { nextIndex = nextIndex === currentPlayList.length - 1 ? 0 : nextIndex + 1; attempts++; if (nextIndex === initialIndex) break; @@ -87,13 +92,18 @@ export default function TabContainerV2({ data: youmaylikeInfos, shopNowInfo_length: shopNowInfo?.length, shouldShowYouMayAlso: - shopNowInfo && shopNowInfo.length < 3 && youmaylikeInfos && youmaylikeInfos.length > 0, + shopNowInfo && + shopNowInfo.length < 3 && + youmaylikeInfos && + youmaylikeInfos.length > 0, }); }, [youmaylikeInfos, shopNowInfo]); const tabList = [ $L('SHOP NOW'), - panelInfo?.shptmBanrTpNm === 'LIVE' ? $L('LIVE CHANNEL') : $L('FEATURED SHOWS'), + panelInfo?.shptmBanrTpNm === 'LIVE' + ? $L('LIVE CHANNEL') + : $L('FEATURED SHOWS'), ]; useEffect(() => { @@ -105,7 +115,9 @@ export default function TabContainerV2({ if (tabIndex === 1) { const isLive = panelInfo?.shptmBanrTpNm === 'LIVE'; - nowMenu = isLive ? LOG_MENU.FULL_LIVE_CHANNELS : LOG_MENU.FULL_FEATURED_SHOWS; + nowMenu = isLive + ? LOG_MENU.FULL_LIVE_CHANNELS + : LOG_MENU.FULL_FEATURED_SHOWS; } if (nowMenu) { @@ -160,7 +172,9 @@ export default function TabContainerV2({ // 하나의 함수에서 모든 tabIndex 변화 처리 const handleTabIndexChange = useCallback((newTabIndex, oldTabIndex) => { - console.log(`[TabIndexChange] Tab changed from ${oldTabIndex} to ${newTabIndex}`); + console.log( + `[TabIndexChange] Tab changed from ${oldTabIndex} to ${newTabIndex}` + ); if (newTabIndex === 0) { // tabIndex = 0 (ShopNow) @@ -220,8 +234,18 @@ export default function TabContainerV2({ Spotlight.focus('shop-now-item-0'); }} > -