update src/components/QandA/index.js, src/components/VerticalExpandableProductFilter/index.js and src/components/VodProduct/index.js

temp
mahdi 2 years ago
parent edd9e32721
commit 7644829a21
  1. 16
      src/components/QandA/index.js
  2. 10
      src/components/VerticalExpandableProductFilter/index.js
  3. 27
      src/components/VodProduct/index.js

@ -8,7 +8,7 @@ import Button from "../Button";
const QandA = ({ comments }) => { const QandA = ({ comments }) => {
const Comment = ({ comment }) => { const Comment = ({ comment }) => {
const [open, Setopen] = useState(true); const [open, Setopen] = useState(true);
const [viewmore, setViewMore] = useState("مشاهده پاسخ های بیشتر"); const [viewmore, setViewMore] = useState(window.t("مشاهده پاسخ های بیشتر"));
const [numberOfAnswers, setNumberOfAnswers] = useState(1); const [numberOfAnswers, setNumberOfAnswers] = useState(1);
const [isOpen, setIsOpen] = useState(false); const [isOpen, setIsOpen] = useState(false);
return ( return (
@ -19,7 +19,9 @@ const QandA = ({ comments }) => {
<div className="flex items-center"> <div className="flex items-center">
<strong className="text-lg mx-2">{comment.username}</strong> <strong className="text-lg mx-2">{comment.username}</strong>
{comment.isCostumer ? ( {comment.isCostumer ? (
<p className="text-greenBA font-light">خریدار محصول</p> <p className="text-greenBA font-light">
{window.t("خریدار محصول")}
</p>
) : null} ) : null}
</div> </div>
</div> </div>
@ -42,7 +44,7 @@ const QandA = ({ comments }) => {
<header className="w-full flex flex-row justify-between items-center"> <header className="w-full flex flex-row justify-between items-center">
<div className="flex flex-row items-center"> <div className="flex flex-row items-center">
<div className="py-4 px-6 bg-blue-100 text-gray-400 rounded"> <div className="py-4 px-6 bg-blue-100 text-gray-400 rounded">
<h1>پرسش</h1> <h1>{window.t("پرسش")}</h1>
</div> </div>
</div> </div>
</header> </header>
@ -62,7 +64,7 @@ const QandA = ({ comments }) => {
<header className="w-full flex flex-row justify-between items-center"> <header className="w-full flex flex-row justify-between items-center">
<div className="flex flex-row items-center"> <div className="flex flex-row items-center">
<div className="py-4 px-6 bg-green-100 text-gray-400 rounded"> <div className="py-4 px-6 bg-green-100 text-gray-400 rounded">
<h1>پاسخ</h1> <h1>{window.t("پاسخال پاسخ")}</h1>
</div> </div>
</div> </div>
</header> </header>
@ -80,7 +82,7 @@ const QandA = ({ comments }) => {
<header className="w-full flex flex-row justify-between items-center"> <header className="w-full flex flex-row justify-between items-center">
<div className="flex w-4/5 flex-row items-center"> <div className="flex w-4/5 flex-row items-center">
<div className="py-4 px-6 bg-green-100 text-gray-400 mx-16 rounded"> <div className="py-4 px-6 bg-green-100 text-gray-400 mx-16 rounded">
<h1>ارسال پاسخ</h1> <h1>{window.t("ارسال پاسخ")}</h1>
</div> </div>
</div> </div>
</header> </header>
@ -101,12 +103,12 @@ const QandA = ({ comments }) => {
isOpen isOpen
? () => { ? () => {
setNumberOfAnswers(1); setNumberOfAnswers(1);
setViewMore(widnow.t("مشاهده پاسخ های بیشتر")); setViewMore(window.t("مشاهده پاسخ های بیشتر"));
setIsOpen(false); setIsOpen(false);
} }
: () => { : () => {
setNumberOfAnswers(comment.answers.length); setNumberOfAnswers(comment.answers.length);
setViewMore("بستن پاسخ ها"); setViewMore(window.t("بستن پاسخ ها"));
setIsOpen(true); setIsOpen(true);
} }
} }

@ -47,7 +47,10 @@ export default function VerticalExpandableProductFilter(props) {
</span> </span>
</form> </form>
)} )}
<ul className="w-full list-none flex flex-col divide-y divide-gray-100 overflow-y-scroll" style={{maxHeight: 'calc(100vh / 3.5)', minHeight: 200}}> <ul
className="w-full list-none flex flex-col divide-y divide-gray-100 overflow-y-scroll"
style={{ maxHeight: "calc(100vh / 3.5)", minHeight: 200 }}
>
{(searchResult.length > 0 ? searchResult : props.list)?.map( {(searchResult.length > 0 ? searchResult : props.list)?.map(
(item1, i) => ( (item1, i) => (
<li <li
@ -65,9 +68,7 @@ export default function VerticalExpandableProductFilter(props) {
onChange={() => props.onChange(name, item1.name)} onChange={() => props.onChange(name, item1.name)}
/> />
<strong className=" text-greenBA text-sm rounded py-1 px-0 font-light"> <strong className=" text-greenBA text-sm rounded py-1 px-0 font-light">
{props.preName {props.preName ? props.preName + " " + item1.name : item1}
? props.preName + " " + item1.name
: item1}
</strong> </strong>
</div> </div>
@ -101,4 +102,3 @@ export default function VerticalExpandableProductFilter(props) {
</div> </div>
); );
} }

@ -99,18 +99,19 @@ const VodProduct = ({
<div className="mt-4 flex flex-col"> <div className="mt-4 flex flex-col">
<div className={`flex justify-between `}> <div className={`flex justify-between `}>
<h2 className={`leading-4 font-semibold text-base mb-4`}> <h2 className={`leading-4 font-semibold text-base mb-4`}>
{"دوره ویدیویی" + " " + video?.name} {`${window.t("دوره ویدیویی")}` + " " + video?.name}
</h2> </h2>
<span className={`text-tiny font-light text-green7B`}> <span className={`text-tiny font-light text-green7B`}>
{"پایه" + " " + grades[video?.gradeId]} {`${window.t("پایه")}` + " " + grades[video?.gradeId]}
</span> </span>
</div> </div>
{productContent && ( {productContent && (
<p <p
className={`text-justify text-sm leading-6 text-productContent`} className={`text-justify text-sm leading-6 text-productContent`}
> >
این کتاب شامل گلدان و گیاه و خاک می باشد و همچنین آپشن های {window.t(
خوب دیگری نیز دارد. "این کتاب شامل گلدان و گیاه و خاک می باشد و همچنین آپشن های خوب دیگری نیز دارد."
)}
</p> </p>
)} )}
</div> </div>
@ -136,7 +137,7 @@ const VodProduct = ({
className={`text-lg text-productPrice font-semibold inline text-blue5F`} className={`text-lg text-productPrice font-semibold inline text-blue5F`}
> >
{separate(video?.product[2]?.price) + " "} {separate(video?.product[2]?.price) + " "}
<span>تومان</span> <span>{window.t("تومان")}</span>
</p> </p>
</div> </div>
{addToCartHolder && ( {addToCartHolder && (
@ -145,7 +146,7 @@ const VodProduct = ({
priceDirection.indexOf("col") !== -1 ? "w-full" : "" priceDirection.indexOf("col") !== -1 ? "w-full" : ""
}`} }`}
> >
اضافه کردن به سبد خرید {window.t("اضافه کردن به سبد خرید")}
</button> </button>
)} )}
</div> </div>
@ -154,13 +155,13 @@ const VodProduct = ({
{productTags && ( {productTags && (
<div className="mt-2 flex flex-wrap"> <div className="mt-2 flex flex-wrap">
<button className="rounded bg-productTagBg text-productTag m-1 px-4 py-1 text-xs"> <button className="rounded bg-productTagBg text-productTag m-1 px-4 py-1 text-xs">
ارسال رایگان {window.t("ارسال رایگان")}
</button> </button>
<button className="rounded bg-productTagBg text-productTag m-1 px-4 py-1 text-xs"> <button className="rounded bg-productTagBg text-productTag m-1 px-4 py-1 text-xs">
برچسب های دیگر {window.t("برچسب های دیگر")}
</button> </button>
<button className="rounded bg-productTagBg text-productTag m-1 px-4 py-1 text-xs"> <button className="rounded bg-productTagBg text-productTag m-1 px-4 py-1 text-xs">
دسته بندی به صورت کادو {window.t("دسته بندی به صورت کادو")}
</button> </button>
</div> </div>
)} )}
@ -187,19 +188,19 @@ VodProduct.defaultProps = {
colors: [ colors: [
{ {
icon: YellowDotIcon, icon: YellowDotIcon,
dataType: "زرد", dataType: window.t("زرد"),
}, },
{ {
icon: RedDotIcon, icon: RedDotIcon,
dataType: "قرمز", dataType: window.t("قرمز"),
}, },
{ {
icon: PurpleDotIcon, icon: PurpleDotIcon,
dataType: "بنفش", dataType: window.t("بنفش"),
}, },
{ {
icon: LightBlueDotIcon, icon: LightBlueDotIcon,
dataType: "آبی", dataType: window.t("آبی"),
}, },
LightBlueDotIcon, LightBlueDotIcon,

Loading…
Cancel
Save