مربوط به مواردی که قبل از این پوش کردم ولی نمیدونم چرا همه را با هم پوش نکرد |60

temp
mahdi andalib 3 years ago
parent 30205e84ff
commit f8205ae2e0
  1. 27
      src/components/ProductStatusCard/index.js
  2. 13
      src/views/Product/Comment/index.js

@ -3,9 +3,9 @@ import { connect } from "react-redux";
import { userProduct } from "../../redux/actions"; import { userProduct } from "../../redux/actions";
import { toast } from "react-toastify"; import { toast } from "react-toastify";
import separate from "../../utils/separate"; import separate from "../../utils/separate";
//components; //components;
import Button from "../Button"; import Button from "../Button";
import location from "../../utils/location";
//assets //assets
import arrow from "./arrow-icon.svg"; import arrow from "./arrow-icon.svg";
@ -14,6 +14,8 @@ import circle from "./info-circle.svg";
import shield from "./shield-tick.svg"; import shield from "./shield-tick.svg";
import tick from "./tick-circle.svg"; import tick from "./tick-circle.svg";
import shop from "./icon-shop.svg"; import shop from "./icon-shop.svg";
import bookmarkDeactiveLightIcon from "../../assets/icons/bookmark-deactive-light.svg";
import bookmarkDeactiveDarkIcon from "../../assets/icons/bookmark-deactive-dark.svg";
const ProductStatusCard = ({ const ProductStatusCard = ({
price, price,
@ -28,7 +30,11 @@ const ProductStatusCard = ({
suggestedCounter, suggestedCounter,
seller, seller,
shippingTime, shippingTime,
addToFavorite,
headerOptions,
}) => { }) => {
const { logo, hamburgerMenu, qr, shown, menu, title, back, bookmark } =
headerOptions;
return ( return (
<section className="w-full" style={{ minWidth: 350 }}> <section className="w-full" style={{ minWidth: 350 }}>
<div className="bg-grayF9 rounded-md px-4 py-2 divide-y divide-solid divide-gray-200"> <div className="bg-grayF9 rounded-md px-4 py-2 divide-y divide-solid divide-gray-200">
@ -56,6 +62,7 @@ const ProductStatusCard = ({
<img src={circle} alt="" className="w-5" /> <img src={circle} alt="" className="w-5" />
</div> </div>
)} )}
<div className="flex flex-row items-center justify-between py-3"> <div className="flex flex-row items-center justify-between py-3">
<div className="flex flex-row items-center"> <div className="flex flex-row items-center">
<img src={delivery} alt="" className="w-8" /> <img src={delivery} alt="" className="w-8" />
@ -66,6 +73,7 @@ const ProductStatusCard = ({
</div> </div>
</div> </div>
</div> </div>
{garanty && ( {garanty && (
<div className="flex flex-row items-center justify-between py-3"> <div className="flex flex-row items-center justify-between py-3">
<div className="flex flex-row items-center"> <div className="flex flex-row items-center">
@ -77,6 +85,22 @@ const ProductStatusCard = ({
</div> </div>
)} )}
{bookmark && (
<div className="flex flex-row items-center py-3">
<img
src={
isDark ? bookmarkDeactiveDarkIcon : bookmarkDeactiveLightIcon
}
alt="bookmark"
className="w-7"
onClick={() => addToFavorite({ [bookmark]: location.getId() })}
/>
<span className="mr-3 text-sm">
اضافه کردن به لیست علاقه مندی ها
</span>
</div>
)}
<div className="flex flex-col items-center py-3"> <div className="flex flex-col items-center py-3">
<p className="text-6xl text-blueC0 font-bold"> <p className="text-6xl text-blueC0 font-bold">
{separate(price)} {separate(price)}
@ -140,6 +164,7 @@ const mapStateToProps = (state) => ({
isDark: state.publicApi.isDark, isDark: state.publicApi.isDark,
isLogin: state.user.status, isLogin: state.user.status,
userId: state.user.status.id, userId: state.user.status.id,
headerOptions: state.publicApi.headerOptions,
}); });
const mapDispatchToProps = { const mapDispatchToProps = {

@ -3,15 +3,22 @@ import userImage from "../../../assets/images/user.png";
function Comment({ comment }) { function Comment({ comment }) {
return ( return (
<div className="flex flex-col py-3 px-2 rounded-md shadow-all border border-gray-200 border-solid dark:border-opacity-10 ml-4 w-auto" style={{minWidth: '250px'}}> <div
className="flex flex-col py-3 px-2 rounded-md shadow-all border border-gray-200 border-solid dark:border-opacity-10 ml-4 w-auto"
style={{ minWidth: "250px" }}
>
<header className="flex flex-row justify-between"> <header className="flex flex-row justify-between">
<div className="flex flex-row items-center"> <div className="flex flex-row items-center">
<img src={userImage} alt="" className="h-10 w-10 rounded-full" /> <img src={userImage} alt="" className="h-10 w-10 rounded-full" />
<strong className="text-blue5F text-md mr-1 dark:text-white">{comment?.name}</strong> <strong className="text-blue5F text-md mr-1 dark:text-white">
{comment?.name}
</strong>
</div> </div>
<div className=""></div> <div className=""></div>
</header> </header>
<p className="text-sm leading-5 text-gray70 mt-2 dark:text-white">{comment?.text}</p> <p className="text-sm leading-5 text-gray70 mt-2 dark:text-white">
{comment?.text}
</p>
</div> </div>
); );
} }

Loading…
Cancel
Save