[251118] feat: LiveChannelNext done

🕐 커밋 시간: 2025. 11. 18. 20:35:55

📊 변경 통계:
  • 총 파일: 5개
  • 추가: +42줄
  • 삭제: -12줄

📝 수정된 파일:
  ~ com.twin.app.shoptime/src/views/PlayerPanel/PlayerOverlay/PlayerOverlayContents.jsx
  ~ com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx
  ~ com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/v2/LiveChannelNext.jsx
  ~ com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/v2/LiveChannelNext.module.less
  ~ com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/v2/TabContainer.v2.jsx

🔧 함수 변경 내용:
  📄 com.twin.app.shoptime/src/views/PlayerPanel/PlayerOverlay/PlayerOverlayContents.jsx (javascript):
    🔄 Modified: SpotlightContainerDecorator()
  📄 com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/v2/LiveChannelNext.jsx (javascript):
    🔄 Modified: Spottable()
  📄 com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/v2/TabContainer.v2.jsx (javascript):
    🔄 Modified: Spottable()
This commit is contained in:
2025-11-18 20:35:55 +09:00
parent af439249dc
commit 08de7888c7
5 changed files with 48 additions and 13 deletions

View File

@@ -1,4 +1,4 @@
import React, { useCallback, useEffect } from 'react';
import React, { useCallback, useEffect, useMemo } from 'react';
import classNames from 'classnames';
import { useSelector } from 'react-redux';
@@ -38,11 +38,39 @@ export default function TabContainerV2({
tabIndex = 1, // tabIndex prop으로 제어 (0: ShopNow, 1: LiveChannel, 2: ShopNowButton)
onShopNowButtonClick,
onLiveChannelButtonClick,
onLiveNext,
onTabClose, // 탭 닫기 콜백 함수
tabVisible,
}) {
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 initialIndex = nextIndex;
let attempts = 0;
// 유효한 showId를 가진 다음 쇼 찾기
while (!currentPlayList[nextIndex]?.showId && attempts < currentPlayList.length) {
nextIndex = nextIndex === currentPlayList.length - 1 ? 0 : nextIndex + 1;
attempts++;
if (nextIndex === initialIndex) break;
}
if (currentPlayList[nextIndex]?.showId) {
return currentPlayList[nextIndex];
}
return null;
}, []);
// 다음 쇼 정보 계산
const nextShowInfo = useMemo(() => {
return findNextPlayableShow(playListInfo, selectedIndex);
}, [playListInfo, selectedIndex, findNextPlayableShow]);
// ✨ DEBUG: youmaylikeInfos 데이터 로그
useEffect(() => {
console.log('[DEBUG] TabContainerV2 - youmaylikeInfos:', {
@@ -242,9 +270,14 @@ export default function TabContainerV2({
{tabVisible && tabIndex === 2 && (
<>
<LiveChannelNext
channelName={playListInfo?.[0]?.showNm || 'ShopLC'}
programName={playListInfo?.[0]?.title || 'Live Channel'}
onClick={onLiveChannelButtonClick}
channelLogo={nextShowInfo?.patncLogoPath}
channelName={nextShowInfo?.patncNm || 'ShopLC'}
programName={nextShowInfo?.showNm || 'Live Channel'}
backgroundColor={
nextShowInfo?.dfltThumbnailImgPath ||
'linear-gradient(180deg, #284998 0%, #06B0EE 100%)'
}
onClick={onLiveNext}
/>
<ShopNowButton onClick={onShopNowButtonClick} />
</>