[251120] fix: ShopNowContents ItemCard Click
🕐 커밋 시간: 2025. 11. 20. 13:58:12 📊 변경 통계: • 총 파일: 3개 • 추가: +22줄 • 삭제: -13줄 📝 수정된 파일: ~ com.twin.app.shoptime/src/actions/panelActions.js ~ com.twin.app.shoptime/src/views/HomePanel/HomePanel.module.less ~ com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/TabContents/ShopNowContents.jsx 🔧 주요 변경 내용: • 핵심 비즈니스 로직 개선 • 소규모 기능 개선 • 코드 정리 및 최적화
This commit is contained in:
@@ -105,14 +105,7 @@ export const navigateToDetail = ({
|
||||
timestamp: Date.now(),
|
||||
});
|
||||
|
||||
// ✅ 그라데이션 배경 표시 - HomePanel→DetailPanel 전환 시
|
||||
dispatch(updateHomeInfo({
|
||||
name: panel_names.HOME_PANEL,
|
||||
panelInfo: {
|
||||
showGradientBackground: true,
|
||||
}
|
||||
}));
|
||||
console.log('[TRACE-GRADIENT] 🟢 navigateToDetail set showGradientBackground: true - source:', sourceMenu);
|
||||
// ✅ 그라데이션 배경은 HomePanel 내부 switch 문에서 처리
|
||||
|
||||
// sourceMenu에 따른 사전 처리
|
||||
switch (sourceMenu) {
|
||||
@@ -124,6 +117,21 @@ export const navigateToDetail = ({
|
||||
case SOURCE_MENUS.HOME_RANDOM_UNIT:
|
||||
case SOURCE_MENUS.HOME_ROLLING_UNIT:
|
||||
case SOURCE_MENUS.HOME_GENERAL: {
|
||||
|
||||
// ✅ 그라데이션 배경 표시 - HomePanel→DetailPanel 전환 시 (PlayerPanel 출신 제외)
|
||||
|
||||
if (!panelInfo.launchedFromPlayer) {
|
||||
dispatch(updateHomeInfo({
|
||||
name: panel_names.HOME_PANEL,
|
||||
panelInfo: {
|
||||
showGradientBackground: true,
|
||||
}
|
||||
}));
|
||||
console.log('[TRACE-GRADIENT] 🟢 navigateToDetail set showGradientBackground: true - source:', sourceMenu);
|
||||
} else {
|
||||
console.log('[TRACE-GRADIENT] 🔵 navigateToDetail skipped gradient - launchedFromPlayer: true');
|
||||
}
|
||||
|
||||
// HomePanel Redux 상태에 포커스 스냅샷 저장 (Detail→Home 복귀 시 사용)
|
||||
if (Object.keys(focusSnapshot).length > 0) {
|
||||
dispatch(
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
// 활성화 상태 - 전체 화면을 어둡게 하는 단색 배경
|
||||
&.visible {
|
||||
display: block;
|
||||
background: rgba(0, 0, 0, 0.85); // 85% 투명도의 검은색으로 전체 화면 어둡게
|
||||
background: rgba(0, 0, 0, 0.75); // 75% 투명도의 검은색으로 전체 화면 어둡게
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ export default function ShopNowContents({
|
||||
// YouMayLike 시작 지점 여부 (구분선 표시)
|
||||
const isYouMayLikeStart = shopNowInfo && index === shopNowInfo.length;
|
||||
|
||||
const handleItemClick = () => {
|
||||
const handleYouMayLikeItemClick = () => {
|
||||
console.log('[ShopNowContents] DetailPanel 진입 - sourceMenu:', SOURCE_MENUS.PLAYER_SHOP_NOW);
|
||||
|
||||
dispatch(
|
||||
@@ -163,6 +163,7 @@ export default function ShopNowContents({
|
||||
showId: playListInfo?.showId,
|
||||
liveFlag: playListInfo?.liveFlag,
|
||||
thumbnailUrl: playListInfo?.thumbnailUrl,
|
||||
launchedFromPlayer: true,
|
||||
},
|
||||
})
|
||||
);
|
||||
@@ -184,7 +185,7 @@ export default function ShopNowContents({
|
||||
offerInfo={offerInfo}
|
||||
productName={prdtNm}
|
||||
productId={prdtId}
|
||||
onClick={handleItemClick}
|
||||
onClick={handleYouMayLikeItemClick}
|
||||
onFocus={() => {
|
||||
if (handleItemFocus) {
|
||||
handleItemFocus(LOG_MENU.FULL_YOU_MAY_LIKE);
|
||||
@@ -220,7 +221,7 @@ export default function ShopNowContents({
|
||||
// 미리 계산된 가격 정보를 사용
|
||||
const { originalPrice, discountedPrice, discountRate } = priceInfoMap[index] || {};
|
||||
|
||||
const handleItemClick = () => {
|
||||
const handleShopNowItemClick = () => {
|
||||
// 현재 포커스된 요소의 spotlightId 저장
|
||||
const currentFocusedElement = Spotlight.getCurrent();
|
||||
const currentSpotlightId = currentFocusedElement?.getAttribute('data-spotlight-id');
|
||||
@@ -274,7 +275,7 @@ export default function ShopNowContents({
|
||||
offerInfo={offerInfo}
|
||||
productName={prdtNm}
|
||||
productId={prdtId}
|
||||
onClick={handleItemClick}
|
||||
onClick={handleShopNowItemClick}
|
||||
onFocus={handleFocus()}
|
||||
spotlightId={`shop-now-item-${index}`}
|
||||
onSpotlightUp={
|
||||
|
||||
Reference in New Issue
Block a user