DetailPanel 폴더 구조 변경 및 쿠폰 로직 수정
This commit is contained in:
@@ -1,21 +1,33 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import React, {
|
||||
useEffect,
|
||||
useState,
|
||||
} from 'react';
|
||||
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import {
|
||||
useDispatch,
|
||||
useSelector,
|
||||
} from 'react-redux';
|
||||
|
||||
import { getMainCategoryDetail } from "../../actions/mainActions";
|
||||
import { popPanel } from "../../actions/panelActions";
|
||||
import TBody from "../../components/TBody/TBody";
|
||||
import THeader from "../../components/THeader/THeader";
|
||||
import TPanel from "../../components/TPanel/TPanel";
|
||||
import ProductOption from "./components/ProductOption";
|
||||
import ProductThumbnail from "./components/ProductThumbnail";
|
||||
import SingleProduct from "./container/SingleProduct";
|
||||
import YouMayLike from "./container/YouMayLike";
|
||||
import css from "./DetailPanel.module.less";
|
||||
import { getProductCouponSearch } from '../../actions/couponActions';
|
||||
import { getMainCategoryDetail } from '../../actions/mainActions';
|
||||
import { popPanel } from '../../actions/panelActions';
|
||||
import { getProductGroup } from '../../actions/productActions';
|
||||
import TBody from '../../components/TBody/TBody';
|
||||
import THeader from '../../components/THeader/THeader';
|
||||
import TPanel from '../../components/TPanel/TPanel';
|
||||
import ProductOption from './components/ProductOption';
|
||||
import ProductThumbnail from './components/ProductThumbnail';
|
||||
import GroupProduct from './container/GroupProduct';
|
||||
import SingleProduct from './container/SingleProduct';
|
||||
import ThemeProduct from './container/ThemeProduct';
|
||||
import UnableProduct from './container/UnableProduct';
|
||||
import YouMayLike from './container/YouMayLike';
|
||||
import css from './DetailPanel.module.less';
|
||||
|
||||
export default function ItemDetail() {
|
||||
const [panelInfo, setPaneInfo] = useState();
|
||||
const productData = useSelector((state) => state.main.productData);
|
||||
const isGroupOption = useSelector((state) => state.main.productGroupYn);
|
||||
const panels = useSelector((state) => state.panels.panels);
|
||||
|
||||
const dispatch = useDispatch();
|
||||
@@ -31,6 +43,7 @@ export default function ItemDetail() {
|
||||
|
||||
useEffect(() => {
|
||||
getPanelInfo();
|
||||
|
||||
if (panels && panelInfo) {
|
||||
dispatch(
|
||||
getMainCategoryDetail({
|
||||
@@ -38,6 +51,13 @@ export default function ItemDetail() {
|
||||
prdtId: panelInfo?.prdtId,
|
||||
})
|
||||
);
|
||||
|
||||
dispatch(
|
||||
getProductGroup({
|
||||
patnrId: panelInfo?.patnrId,
|
||||
prdtId: panelInfo?.prdtId,
|
||||
})
|
||||
);
|
||||
}
|
||||
}, [dispatch, panels, panelInfo]);
|
||||
|
||||
@@ -53,10 +73,29 @@ export default function ItemDetail() {
|
||||
onClick={onClick}
|
||||
/>
|
||||
<TBody className={css.container} scrollable={false}>
|
||||
<SingleProduct
|
||||
{/* 단일상품 영역 */}
|
||||
{productData?.pmtSuptYn === "Y" && (
|
||||
<SingleProduct selectedPatnrId={"11"} selectedPrdtId={"7280567"} />
|
||||
)}
|
||||
{/* 그룹상품 영역 */}
|
||||
{isGroupOption && isGroupOption === "Y" && (
|
||||
<GroupProduct
|
||||
selectedPatnrId={panelInfo?.patnrId}
|
||||
selectedPrdtId={panelInfo?.prdtId}
|
||||
/>
|
||||
)}
|
||||
{/* 구매불가상품 영역 */}
|
||||
{productData?.pmtSuptYn === "N" && (
|
||||
<UnableProduct
|
||||
selectedPatnrId={panelInfo?.patnrId}
|
||||
selectedPrdtId={panelInfo?.prdtId}
|
||||
/>
|
||||
)}
|
||||
{/* 테마그룹상품 영역*/}
|
||||
{/* <ThemeProduct
|
||||
selectedPatnrId={panelInfo?.patnrId}
|
||||
selectedPardtId={panelInfo?.prdtId}
|
||||
/>
|
||||
selectedPrdtId={panelInfo?.prdtId}
|
||||
/> */}
|
||||
</TBody>
|
||||
<YouMayLike />
|
||||
</TPanel>
|
||||
|
||||
Reference in New Issue
Block a user