DetailPanel 인디게이터 Media 구현
This commit is contained in:
@@ -29,6 +29,7 @@ export default function ItemDetail() {
|
||||
const [themeType, setThemeType] = useState("");
|
||||
const [selectedIndex, setSelectedIndex] = useState(0);
|
||||
|
||||
const youmaylikeData = useSelector((state) => state.main.youmaylikeData);
|
||||
const productData = useSelector((state) => state.main.productData);
|
||||
const themeData = useSelector((state) => state.home.productData);
|
||||
const panels = useSelector((state) => state.panels.panels);
|
||||
@@ -131,20 +132,18 @@ export default function ItemDetail() {
|
||||
}, [panels, selectedPatnrId, selectedPatnrId, httpHeader]);
|
||||
|
||||
const getCategoryId = useCallback(() => {
|
||||
setCategoryId("");
|
||||
|
||||
if (productData && !selectedCurationId) {
|
||||
return setCategoryId(productData.catCd);
|
||||
}
|
||||
if (
|
||||
setCategoryId(productData.catCd);
|
||||
} else if (
|
||||
themeProductInfos[selectedIndex]?.pmtSuptYn === "N" &&
|
||||
selectedCurationId
|
||||
) {
|
||||
return setCategoryId(themeProductInfos[selectedIndex]?.catCd);
|
||||
setCategoryId(themeProductInfos[selectedIndex]?.catCd);
|
||||
} else {
|
||||
setCategoryId("");
|
||||
}
|
||||
}, [productData, themeProductInfos, selectedIndex]);
|
||||
}, [productData, themeProductInfos, selectedIndex, selectedCurationId]);
|
||||
|
||||
console.log("#themeProductInfos", themeProductInfos);
|
||||
useEffect(() => {
|
||||
getCategoryId();
|
||||
}, [themeProductInfos, productData, selectedIndex]);
|
||||
|
||||
Reference in New Issue
Block a user