[Home] Category 정보 LNB 전달
Detail Notes : 1. Category List에서 “+” 버튼 클릭시 lgCatCd 정보 전달
This commit is contained in:
@@ -21,10 +21,10 @@ export default memo(function CategoryNavItem({
|
|||||||
} = categoryInfos[index];
|
} = categoryInfos[index];
|
||||||
|
|
||||||
const handleClick = useCallback(
|
const handleClick = useCallback(
|
||||||
(categoryCode) => {
|
(categoryCode, categoryName) => {
|
||||||
onCategoryNavClick && onCategoryNavClick(categoryCode);
|
onCategoryNavClick && onCategoryNavClick(categoryCode, categoryName);
|
||||||
},
|
},
|
||||||
[categoryCode, currentCategoryCode]
|
[categoryCode, categoryName, currentCategoryCode]
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -34,7 +34,7 @@ export default memo(function CategoryNavItem({
|
|||||||
categoryCode === currentCategoryCode && css.selected
|
categoryCode === currentCategoryCode && css.selected
|
||||||
)}
|
)}
|
||||||
key={categoryCode}
|
key={categoryCode}
|
||||||
onClick={() => handleClick(categoryCode)}
|
onClick={() => handleClick(categoryCode, categoryName)}
|
||||||
spotlightId={"spotlightId-" + categoryCode}
|
spotlightId={"spotlightId-" + categoryCode}
|
||||||
{...rest}
|
{...rest}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -59,6 +59,9 @@ const SubCategory = ({ order }) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log("##lgCatCd", lgCatCd);
|
||||||
|
console.log("##LgCatNm", LgCatNm);
|
||||||
|
|
||||||
setCurrentLgCatCd(lgCatCd);
|
setCurrentLgCatCd(lgCatCd);
|
||||||
setCurrentLgCatNm(LgCatNm);
|
setCurrentLgCatNm(LgCatNm);
|
||||||
setCurrentCOUNT(COUNT);
|
setCurrentCOUNT(COUNT);
|
||||||
@@ -84,6 +87,7 @@ const SubCategory = ({ order }) => {
|
|||||||
lgCatCd: currentLgCatCd,
|
lgCatCd: currentLgCatCd,
|
||||||
lgCatNm: currentLgCatNm,
|
lgCatNm: currentLgCatNm,
|
||||||
COUNT: currentCOUNT,
|
COUNT: currentCOUNT,
|
||||||
|
spotlightId: `secondDetph-${currentLgCatCd}`,
|
||||||
},
|
},
|
||||||
//lgCatCd, lgCatNm, COUNT
|
//lgCatCd, lgCatNm, COUNT
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user