|
|
@ -9,18 +9,18 @@ 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("مشاهده پاسخ های بیشتر"); |
|
|
|
const [numberOfAnswers, setNumberOfAnswers] = useState(1); |
|
|
|
const [numberOfAnswers, setNumberOfAnswers] = useState(1); |
|
|
|
const [isOpen, setIsOpen] = useState(false); |
|
|
|
const [isOpen, setIsOpen] = useState(false); |
|
|
|
return ( |
|
|
|
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"> |
|
|
|
<header className="w-full flex flex-row justify-between py-1"> |
|
|
|
<div className="flex flex-row items-end"> |
|
|
|
<div className="flex flex-row items-end"> |
|
|
|
<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-blueC0">خریدار محصول</p> |
|
|
|
<p className="text-greenBA font-light">خریدار محصول</p> |
|
|
|
) : null} |
|
|
|
) : null} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -43,7 +43,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>پرسش</h1> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</header> |
|
|
|
</header> |
|
|
@ -63,7 +63,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>پاسخ</h1> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</header> |
|
|
|
</header> |
|
|
@ -81,7 +81,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>ارسال پاسخ</h1> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</header> |
|
|
|
</header> |
|
|
@ -102,12 +102,12 @@ const QandA = ({ comments }) => { |
|
|
|
isOpen |
|
|
|
isOpen |
|
|
|
? () => { |
|
|
|
? () => { |
|
|
|
setNumberOfAnswers(1); |
|
|
|
setNumberOfAnswers(1); |
|
|
|
setViewMore("مشاهده باسخ های بیشتر"); |
|
|
|
setViewMore("مشاهده پاسخ های بیشتر"); |
|
|
|
setIsOpen(false); |
|
|
|
setIsOpen(false); |
|
|
|
} |
|
|
|
} |
|
|
|
: () => { |
|
|
|
: () => { |
|
|
|
setNumberOfAnswers(comment.answers.length); |
|
|
|
setNumberOfAnswers(comment.answers.length); |
|
|
|
setViewMore("بستن باسخ ها"); |
|
|
|
setViewMore("بستن پاسخ ها"); |
|
|
|
setIsOpen(true); |
|
|
|
setIsOpen(true); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|