|
|
|
@ -8,6 +8,7 @@ import Button from "../../../../components/Button"; |
|
|
|
|
import Header from "../../../../components/Header"; |
|
|
|
|
import Comment from "../../Comment"; |
|
|
|
|
import Rate from "../../Rate"; |
|
|
|
|
import StarRating from "../../../../components/StarRating"; |
|
|
|
|
|
|
|
|
|
export const ProductOverAll = ({ |
|
|
|
|
productType, |
|
|
|
@ -19,21 +20,22 @@ export const ProductOverAll = ({ |
|
|
|
|
pushToCart, |
|
|
|
|
headerOptions, |
|
|
|
|
setHeaderOptions, |
|
|
|
|
}) =>{ |
|
|
|
|
}) => { |
|
|
|
|
const [type, setType] = useState("physical"); |
|
|
|
|
return ( |
|
|
|
|
|
|
|
|
|
<div> |
|
|
|
|
<header |
|
|
|
|
className={`w-full flex`} |
|
|
|
|
className={`w-full flex justify-between`} |
|
|
|
|
> |
|
|
|
|
<img |
|
|
|
|
src={`https://dnvn.ir/api/v1/file/${book?.fileIds}`} |
|
|
|
|
alt="" |
|
|
|
|
style={{height: '320px'}} |
|
|
|
|
style={{ height: '320px' }} |
|
|
|
|
className="-md py-8 px-16 bg-grayF4 mx-4" |
|
|
|
|
/> |
|
|
|
|
<div className="flex flex-1 flex-col pr-2 pt-2"> |
|
|
|
|
<div className="flex flex-col flex-1 "> |
|
|
|
|
<div className="flex flex-col pr-2 py-2 border-0 border-b border-solid border-gray-100"> |
|
|
|
|
<h1 className="text-blue5F mb-3 font-semibold text-xl dark:text-white"> |
|
|
|
|
{type === "digital" |
|
|
|
|
? book?.product[0]?.name |
|
|
|
@ -42,48 +44,80 @@ export const ProductOverAll = ({ |
|
|
|
|
<div className="text-blueC0 text-xs dark:text-greenBA"> |
|
|
|
|
{"پایه" + " " + grades[book?.gradeId]} |
|
|
|
|
</div> |
|
|
|
|
<div className="flex float-left justify-end"> |
|
|
|
|
<div className="p-2"> |
|
|
|
|
<StarRating /> |
|
|
|
|
</div> |
|
|
|
|
<div className="p-2 border-0 border-solid border-r border-gray-100 text-sm text-gray-400"> |
|
|
|
|
بیش از 160 نفر امتیاز داده اند |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
</header> |
|
|
|
|
<ul |
|
|
|
|
className="list-none flex flex-row divide-x items-center mt-4" |
|
|
|
|
style={{ direction: "ltr" }} |
|
|
|
|
> |
|
|
|
|
<li className="border-solid border-blueFE flex-1 flex-shrink-0 text-center text-xs font-medium text-blueC0 dark:text-white"> |
|
|
|
|
{book?.pagesNum} <br /> صفحه |
|
|
|
|
</li> |
|
|
|
|
<li className="border-solid border-blueFE flex-1 flex-shrink-0 text-center text-xs font-medium text-blueC0 dark:text-white"> |
|
|
|
|
{"فیزیکی - دیجیتالی"} <br /> در دسترس |
|
|
|
|
</li> |
|
|
|
|
<li className="border-solid border-blueFE flex-1 flex-shrink-0 text-center text-xs font-medium text-blueC0 dark:text-white"> |
|
|
|
|
{book?.rate} <br /> امتیاز |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
|
<h2 className="text-blueC0 text-sm font-semibold mt-7 dark:text-greenBA"> |
|
|
|
|
نسخه محصول را انتخاب کنید |
|
|
|
|
</h2> |
|
|
|
|
<div className="py-4 border-0 border-b border-solid border-gray-100"> |
|
|
|
|
<div className="flex items-center py-2"> |
|
|
|
|
<h1>نوع کتاب</h1> |
|
|
|
|
<p className=" text-xs px-4 text-blueE8">به من کمک کن انتخاب کنم</p> |
|
|
|
|
</div> |
|
|
|
|
<div className="w-full flex flex-row justify-between items-center mt-4"> |
|
|
|
|
<Button |
|
|
|
|
title="نسخه فیزیکی" |
|
|
|
|
backgroundColor={isDark ? "bg-transparent" : "bg-white"} |
|
|
|
|
border={{ color: isDark ? "#ffffff55" : "#196EC055", width: "1px" }} |
|
|
|
|
width="49%" |
|
|
|
|
color={isDark ? "text-white" : "text-blueC0"} |
|
|
|
|
active={type === "physical"} |
|
|
|
|
selectable={true} |
|
|
|
|
onClick={() => setType("physical")} |
|
|
|
|
borderType='dashed' |
|
|
|
|
customStyle='' |
|
|
|
|
twPaddings='py-4 px-12' |
|
|
|
|
radius={false} |
|
|
|
|
/> |
|
|
|
|
<Button |
|
|
|
|
title="نسخه دیجیتال" |
|
|
|
|
backgroundColor={isDark ? "bg-transparent" : "bg-white"} |
|
|
|
|
border={{ color: isDark ? "#ffffff55" : "#196EC055", width: "1px" }} |
|
|
|
|
width="49%" |
|
|
|
|
selectable={true} |
|
|
|
|
active={type === "digital"} |
|
|
|
|
color={isDark ? "text-white" : "text-blueC0"} |
|
|
|
|
onClick={() => setType("digital")} |
|
|
|
|
radius={false} |
|
|
|
|
twPaddings='py-4 px-12' |
|
|
|
|
/> |
|
|
|
|
<Button |
|
|
|
|
title="مشاهده نمونه" |
|
|
|
|
backgroundColor={isDark ? "bg-transparent" : "bg-white"} |
|
|
|
|
border={{ color: isDark ? "#ffffff55" : "#C01919", width: "1px" }} |
|
|
|
|
radius={false} |
|
|
|
|
twPaddings='py-4 px-6' |
|
|
|
|
color={isDark ? "text-white" : "text-red19"} |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div> |
|
|
|
|
<h1>aopdjsoqweqweqweqweqweWajsduh</h1> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
</header> |
|
|
|
|
<ul |
|
|
|
|
className="list-none flex flex-row divide-x items-center mt-4" |
|
|
|
|
style={{ direction: "ltr" }} |
|
|
|
|
> |
|
|
|
|
<li className="border-solid border-blueFE flex-1 flex-shrink-0 text-center text-xs font-medium text-blueC0 dark:text-white"> |
|
|
|
|
{book?.pagesNum} <br /> صفحه |
|
|
|
|
</li> |
|
|
|
|
<li className="border-solid border-blueFE flex-1 flex-shrink-0 text-center text-xs font-medium text-blueC0 dark:text-white"> |
|
|
|
|
{"فیزیکی - دیجیتالی"} <br /> در دسترس |
|
|
|
|
</li> |
|
|
|
|
<li className="border-solid border-blueFE flex-1 flex-shrink-0 text-center text-xs font-medium text-blueC0 dark:text-white"> |
|
|
|
|
{book?.rate} <br /> امتیاز |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
|
<h2 className="text-blueC0 text-sm font-semibold mt-7 dark:text-greenBA"> |
|
|
|
|
نسخه محصول را انتخاب کنید |
|
|
|
|
</h2> |
|
|
|
|
|
|
|
|
|
<div className="w-full flex flex-row justify-between items-center mt-4"> |
|
|
|
|
<Button |
|
|
|
|
onClick={() => |
|
|
|
@ -112,13 +146,7 @@ export const ProductOverAll = ({ |
|
|
|
|
width="65%" |
|
|
|
|
color="text-white" |
|
|
|
|
/> |
|
|
|
|
<Button |
|
|
|
|
title="مشاهده نمونه" |
|
|
|
|
backgroundColor={isDark ? "bg-transparent" : "bg-white"} |
|
|
|
|
border={{ color: isDark ? "#ffffff55" : "#196EC055", width: "1px" }} |
|
|
|
|
width="33%" |
|
|
|
|
color={isDark ? "text-white" : "text-blueC0"} |
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
<div className="w-full flex flex-row justify-between items-center mt-4"> |
|
|
|
|
<Button |
|
|
|
@ -152,13 +180,12 @@ const mapStateToProps = (state) => ({ |
|
|
|
|
grades: state.publicApi.grades, |
|
|
|
|
isDark: state.publicApi.isDark, |
|
|
|
|
userId: state.user.status.id, |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
const mapDispatchToProps = { |
|
|
|
|
const mapDispatchToProps = { |
|
|
|
|
getInfo: book.info, |
|
|
|
|
pushToCart: userProduct.add, |
|
|
|
|
setHeaderOptions: publicApi.setHeaderOptions, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(ProductOverAll); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(ProductOverAll); |
|
|
|
|