[DetailPanel] Option component 폴더 및 파일 추가

This commit is contained in:
jiwon93.son
2024-02-16 15:26:28 +09:00
parent dd7bb03c2a
commit e1293514ba
9 changed files with 79 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ import { getMainCategoryDetail } from "../../actions/mainActions";
import TBody from "../../components/TBody/TBody";
import THeader from "../../components/THeader/THeader";
import TPanel from "../../components/TPanel/TPanel";
import ProductOption from "./container/ProductOption";
import ProductThumbnail from "./container/ProductThumbnail";
import css from "./DetailPanel.module.less";
@@ -38,6 +39,10 @@ export default function ItemDetail() {
/>
<TBody className={css.container} scrollable={false}>
<ProductThumbnail productData={productData} />
<ProductOption
selectedPatnrId={selectedPatnrId}
selectedPardtId={selectedPardtId}
/>
</TBody>
</TPanel>
);

View File

@@ -0,0 +1,5 @@
import React from 'react';
export default function OptionCommon() {
return <div>OptionCommon</div>;
}

View File

@@ -0,0 +1,13 @@
import React from "react";
import Spottable from "@enact/spotlight/Spottable";
const SpottableComponent = Spottable("div");
export default function OptionGroup() {
<div>
<p>description</p>
<SpottableComponent>{"item"}</SpottableComponent>
</div>;
return <div>OptionGroup</div>;
}

View File

@@ -0,0 +1,5 @@
import React from "react";
export default function OptionHotel() {
return <div>OptionHotel</div>;
}

View File

@@ -0,0 +1,51 @@
import React, { useEffect } from 'react';
import {
useDispatch,
useSelector,
} from 'react-redux';
import {
getProductGroup,
getProductOption,
} from '../../../actions/productActions';
import OptionGroup from '../components/optionTypes/OptionGroup';
import css from './ProductOption.module.less';
export default function ProductOption({ selectedPatnrId, selectedPardtId }) {
const dispatch = useDispatch();
const productOpionInfos = useSelector((state) => state.product.prdtOptInfo);
const groupInfos = useSelector((state) => state.product.groupInfo);
console.log("# productOpionInfos", productOpionInfos);
console.log("# groupInfos", groupInfos);
useEffect(() => {
dispatch(
getProductOption({
patnrId: selectedPatnrId,
prdtId: selectedPardtId,
})
);
dispatch(
getProductGroup({
patnrId: selectedPatnrId,
prdtId: selectedPardtId,
})
);
}, [dispatch]);
return (
<div>
<div className={css.optionLayerTop}>
<div className={css.partner}>partner</div>
<div className={css.brandName}>brandName</div>
<div className={css.specialPrice}>specialPrice</div>
</div>
<div>
<OptionGroup />
</div>
</div>
);
}