[Home] Category 정보 LNB 전달

Detail Notes :

1. Category List에서 “+” 버튼 클릭시 lgCatCd 정보 전달
This commit is contained in:
jangheon Pyo
2024-03-26 15:02:28 +09:00
parent 907c1afa3b
commit a30be75e09
2 changed files with 8 additions and 4 deletions

View File

@@ -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}
>

View File

@@ -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
},