From e3595eec5134d00dbedaaec3b742da20689042e7 Mon Sep 17 00:00:00 2001 From: "opacity@t-win.kr" Date: Mon, 3 Nov 2025 17:43:53 +0900 Subject: [PATCH] =?UTF-8?q?[SHOPTIME-5486]=20=20Home=20/=20=ED=95=98?= =?UTF-8?q?=EB=8B=A8=EC=97=90=20On=20Sale=20=EB=9E=9C=EB=94=A9=20=EC=B9=B4?= =?UTF-8?q?=EB=93=9C=20/=20=EC=B9=B4=EB=93=9C=EC=97=90=20=EB=85=B8?= =?UTF-8?q?=EC=B6=9C=EB=90=98=EB=8A=94=20=EC=B9=B4=ED=85=8C=EA=B3=A0?= =?UTF-8?q?=EB=A6=AC=EC=9D=B4=EB=8F=99=EB=90=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CategoryNavItem/CategoryNavItem.jsx | 11 ++++------- .../src/views/OnSalePanel/OnSaleNav/OnSaleNav.jsx | 6 +++--- .../OnSaleNav/OnSaleNavItem/OnSaleNavItem.jsx | 10 +++++----- .../src/views/OnSalePanel/OnSalePanel.jsx | 14 +++++--------- 4 files changed, 17 insertions(+), 24 deletions(-) diff --git a/com.twin.app.shoptime/src/views/HomePanel/SubCategory/CategoryNav/CategoryNavItem/CategoryNavItem.jsx b/com.twin.app.shoptime/src/views/HomePanel/SubCategory/CategoryNav/CategoryNavItem/CategoryNavItem.jsx index 64004d1e..96e75f57 100644 --- a/com.twin.app.shoptime/src/views/HomePanel/SubCategory/CategoryNav/CategoryNavItem/CategoryNavItem.jsx +++ b/com.twin.app.shoptime/src/views/HomePanel/SubCategory/CategoryNav/CategoryNavItem/CategoryNavItem.jsx @@ -1,13 +1,10 @@ -import React, { - memo, - useCallback, -} from 'react'; +import React, { memo, useCallback } from "react"; -import classNames from 'classnames'; +import classNames from "classnames"; -import Spottable from '@enact/spotlight/Spottable'; +import Spottable from "@enact/spotlight/Spottable"; -import css from './CategoryNavItem.module.less'; +import css from "./CategoryNavItem.module.less"; const SpottableComponent = Spottable("div"); diff --git a/com.twin.app.shoptime/src/views/OnSalePanel/OnSaleNav/OnSaleNav.jsx b/com.twin.app.shoptime/src/views/OnSalePanel/OnSaleNav/OnSaleNav.jsx index d0f23d6e..e78f955a 100644 --- a/com.twin.app.shoptime/src/views/OnSalePanel/OnSaleNav/OnSaleNav.jsx +++ b/com.twin.app.shoptime/src/views/OnSalePanel/OnSaleNav/OnSaleNav.jsx @@ -76,9 +76,9 @@ export default function OnSaleNav({ const containerId = "on-sale-nav"; setContainerLastFocusedElement(node, [containerId]); } - setTimeout(() => { - Spotlight.focus(node); - }, 100); + // setTimeout(() => { + // Spotlight.focus(node); + // }, 100); } }, [panelInfoLgCatCd]); diff --git a/com.twin.app.shoptime/src/views/OnSalePanel/OnSaleNav/OnSaleNavItem/OnSaleNavItem.jsx b/com.twin.app.shoptime/src/views/OnSalePanel/OnSaleNav/OnSaleNavItem/OnSaleNavItem.jsx index 296a078b..2e527a6a 100644 --- a/com.twin.app.shoptime/src/views/OnSalePanel/OnSaleNav/OnSaleNavItem/OnSaleNavItem.jsx +++ b/com.twin.app.shoptime/src/views/OnSalePanel/OnSaleNav/OnSaleNavItem/OnSaleNavItem.jsx @@ -1,7 +1,7 @@ import React, { memo, useCallback, useEffect } from "react"; import classNames from "classnames"; -import { useDispatch } from "react-redux"; +import { connect, useDispatch } from "react-redux"; import Spottable from "@enact/spotlight/Spottable"; import { setContainerLastFocusedElement } from "@enact/spotlight/src/container"; @@ -32,8 +32,8 @@ export default memo(function OnSaleNavItem({ const selected = selectedLgCatCd ? selectedLgCatCd === lgCatCd && css.selected : panelInfoLgCatCd - ? panelInfoLgCatCd === lgCatCd && css.selected - : itemIndex === 0; + ? panelInfoLgCatCd === lgCatCd && css.selected + : itemIndex === 0; const selectedText = selected === true ? "Selected, " : ""; @@ -77,8 +77,8 @@ export default memo(function OnSaleNavItem({ selectedLgCatCd ? selectedLgCatCd === lgCatCd && css.selected : panelInfoLgCatCd - ? panelInfoLgCatCd === lgCatCd && css.selected - : itemIndex === 0 && css.selected + ? panelInfoLgCatCd === lgCatCd && css.selected + : itemIndex === 0 && css.selected )} onClick={handleClick} id={"spotlightId-" + lgCatCd} diff --git a/com.twin.app.shoptime/src/views/OnSalePanel/OnSalePanel.jsx b/com.twin.app.shoptime/src/views/OnSalePanel/OnSalePanel.jsx index 0e151653..dbbb731a 100644 --- a/com.twin.app.shoptime/src/views/OnSalePanel/OnSalePanel.jsx +++ b/com.twin.app.shoptime/src/views/OnSalePanel/OnSalePanel.jsx @@ -57,8 +57,8 @@ export default function OnSalePanel({ panelInfo, spotlightId }) { const enteredThroughEventPopup = Object.keys(panelInfo).length === 1; const enteredThroughGNB = Object.keys(panelInfo).length === 0; - const previousPanelIsHome = Object.keys(panelInfo).length === 3; - const previousPanelIsDetail = Object.keys(panelInfo).length > 4; + const previousPanelIsHome = panelInfo?.nowShelf !== undefined; + const previousPanelIsDetail = panelInfo?.noResetFlag === true; const cbChangePageRef = useRef(null); const focusedContainerIdRef = useRef(0); @@ -132,7 +132,7 @@ export default function OnSalePanel({ panelInfo, spotlightId }) { useEffect(() => { if (categories && saleInfos && Object.keys(saleInfos).length > 0) { const prdtId = saleInfos[0]?.saleProductInfos[0]?.prdtId; - + console.log("###prdtId", saleInfos); if (prdtId) { setFirstFocusableTarget("spotlightId-" + removeDotAndColon(prdtId)); setIsReadyForInitialFocusTarget(true); @@ -149,9 +149,8 @@ export default function OnSalePanel({ panelInfo, spotlightId }) { } if (previousPanelIsHome) { - targetId = panelInfo?.linkTpCd - ? "spotlightId-" + panelInfo?.lgCatCd - : "spotlightId-" + panelInfo?.prdtId; + // 홈에서 온세일 아이템을 선택한 경우 해당 카테고리의 nav 아이템에 포커스 + targetId = "spotlightId-" + panelInfo?.lgCatCd; } if (enteredThroughEventPopup) { @@ -180,8 +179,6 @@ export default function OnSalePanel({ panelInfo, spotlightId }) { isInitialFocusOccurred, isReadyForInitialFocusTarget, panelInfo?.lgCatCd, - panelInfo?.linkTpCd, - panelInfo?.prdtId, panelInfo?.targetId, previousPanelIsDetail, previousPanelIsHome, @@ -300,7 +297,6 @@ export default function OnSalePanel({ panelInfo, spotlightId }) { cbChangePageRef.current(0); } }, []); - const handleShelfFocus = useCallback( (shelfOrder) => { // 현재 포커스된 shelf와 다른 shelf에 포커스될 때만 true 반환