From a30be75e097f8fb299d438b7e3c0ed8cc1ca1eb8 Mon Sep 17 00:00:00 2001 From: jangheon Pyo Date: Tue, 26 Mar 2024 15:02:28 +0900 Subject: [PATCH] =?UTF-8?q?[Home]=20Category=20=EC=A0=95=EB=B3=B4=20LNB=20?= =?UTF-8?q?=EC=A0=84=EB=8B=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Detail Notes : 1. Category List에서 “+” 버튼 클릭시 lgCatCd 정보 전달 --- .../CategoryNav/CategoryNavItem/CategoryNavItem.jsx | 8 ++++---- .../src/views/HomePanel/SubCategory/SubCategory.jsx | 4 ++++ 2 files changed, 8 insertions(+), 4 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 a6178b5f..e39aaa2c 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 @@ -21,10 +21,10 @@ export default memo(function CategoryNavItem({ } = categoryInfos[index]; const handleClick = useCallback( - (categoryCode) => { - onCategoryNavClick && onCategoryNavClick(categoryCode); + (categoryCode, categoryName) => { + onCategoryNavClick && onCategoryNavClick(categoryCode, categoryName); }, - [categoryCode, currentCategoryCode] + [categoryCode, categoryName, currentCategoryCode] ); return ( @@ -34,7 +34,7 @@ export default memo(function CategoryNavItem({ categoryCode === currentCategoryCode && css.selected )} key={categoryCode} - onClick={() => handleClick(categoryCode)} + onClick={() => handleClick(categoryCode, categoryName)} spotlightId={"spotlightId-" + categoryCode} {...rest} > diff --git a/com.twin.app.shoptime/src/views/HomePanel/SubCategory/SubCategory.jsx b/com.twin.app.shoptime/src/views/HomePanel/SubCategory/SubCategory.jsx index af7eef00..4fd0401e 100644 --- a/com.twin.app.shoptime/src/views/HomePanel/SubCategory/SubCategory.jsx +++ b/com.twin.app.shoptime/src/views/HomePanel/SubCategory/SubCategory.jsx @@ -59,6 +59,9 @@ const SubCategory = ({ order }) => { return; } + console.log("##lgCatCd", lgCatCd); + console.log("##LgCatNm", LgCatNm); + setCurrentLgCatCd(lgCatCd); setCurrentLgCatNm(LgCatNm); setCurrentCOUNT(COUNT); @@ -84,6 +87,7 @@ const SubCategory = ({ order }) => { lgCatCd: currentLgCatCd, lgCatNm: currentLgCatNm, COUNT: currentCOUNT, + spotlightId: `secondDetph-${currentLgCatCd}`, }, //lgCatCd, lgCatNm, COUNT },