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