|
|
|
@ -9,18 +9,18 @@ import Button from "../Button"; |
|
|
|
|
const QandA = ({ comments }) => { |
|
|
|
|
const Comment = ({ comment }) => { |
|
|
|
|
const [open, Setopen] = useState(true); |
|
|
|
|
const [viewmore, setViewMore] = useState("مشاهده باسخ های بیشتر"); |
|
|
|
|
const [viewmore, setViewMore] = useState("مشاهده پاسخ های بیشتر"); |
|
|
|
|
const [numberOfAnswers, setNumberOfAnswers] = useState(1); |
|
|
|
|
const [isOpen, setIsOpen] = useState(false); |
|
|
|
|
return ( |
|
|
|
|
<> |
|
|
|
|
<div className="flex flex-col w-full py-6 border-t-2 border-solid border-gray-200"> |
|
|
|
|
<div className="flex flex-col leading-7 w-full py-6 border-t-2 border-solid border-gray-200"> |
|
|
|
|
<header className="w-full flex flex-row justify-between py-1"> |
|
|
|
|
<div className="flex flex-row items-end"> |
|
|
|
|
<div className="flex items-center"> |
|
|
|
|
<strong className="text-lg mx-2">{comment.username}</strong> |
|
|
|
|
{comment.isCostumer ? ( |
|
|
|
|
<p className="text-blueC0">خریدار محصول</p> |
|
|
|
|
<p className="text-greenBA font-light">خریدار محصول</p> |
|
|
|
|
) : null} |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
@ -43,7 +43,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>پرسش</h1> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</header> |
|
|
|
@ -63,7 +63,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>پاسخ</h1> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</header> |
|
|
|
@ -81,7 +81,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>ارسال پاسخ</h1> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</header> |
|
|
|
@ -102,12 +102,12 @@ const QandA = ({ comments }) => { |
|
|
|
|
isOpen |
|
|
|
|
? () => { |
|
|
|
|
setNumberOfAnswers(1); |
|
|
|
|
setViewMore("مشاهده باسخ های بیشتر"); |
|
|
|
|
setViewMore("مشاهده پاسخ های بیشتر"); |
|
|
|
|
setIsOpen(false); |
|
|
|
|
} |
|
|
|
|
: () => { |
|
|
|
|
setNumberOfAnswers(comment.answers.length); |
|
|
|
|
setViewMore("بستن باسخ ها"); |
|
|
|
|
setViewMore("بستن پاسخ ها"); |
|
|
|
|
setIsOpen(true); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|