diff --git a/client/src/components/QAComponents/Answer.jsx b/client/src/components/QAComponents/Answer.jsx index a1d45f1..7cc1808 100644 --- a/client/src/components/QAComponents/Answer.jsx +++ b/client/src/components/QAComponents/Answer.jsx @@ -1,5 +1,7 @@ import CheckIcon from '@mui/icons-material/Check'; +import ShareIcon from '@mui/icons-material/Share'; import { Button, ButtonGroup, ListItem, ListItemText, Tooltip } from '@mui/material'; +import { CopyToClipboard } from 'react-copy-to-clipboard'; import { Markdown } from 'components'; import { CreationInfoTag } from 'controllers'; @@ -14,12 +16,12 @@ export default function Answer({ downvotes, text, upvotes, + acceptAnswer, canComment, canAccept, + postComment, getVote, updateVote, - postComment, - acceptAnswer, }) { return ( @@ -47,12 +49,26 @@ export default function Answer({ + + + {canAccept && ( diff --git a/client/src/components/QAComponents/CommentControl.jsx b/client/src/components/QAComponents/CommentControl.jsx index 43fb4e4..d8eaa8f 100644 --- a/client/src/components/QAComponents/CommentControl.jsx +++ b/client/src/components/QAComponents/CommentControl.jsx @@ -27,11 +27,12 @@ export default function CommentControl({ color='inherit' disableRipple onClick={toggleShow} + m={1} size='small' startIcon={} style={{ textTransform: 'none' }} variant='text' - > + > Comment diff --git a/client/src/components/QAComponents/Question.jsx b/client/src/components/QAComponents/Question.jsx index b55a58f..82354b5 100644 --- a/client/src/components/QAComponents/Question.jsx +++ b/client/src/components/QAComponents/Question.jsx @@ -41,7 +41,6 @@ export default function Question({ text, upvotes, views, - question_id, ongoingVote, canClose, canProtect, @@ -121,18 +120,6 @@ export default function Question({ - - - - {ongoingVote.users.length > 0 && ( {ongoingVote.users.toString()} - voting to {ongoingVote.type} this question{' '} @@ -156,6 +143,18 @@ export default function Question({ + + + diff --git a/client/src/controllers/QAControllers/AnswerController.jsx b/client/src/controllers/QAControllers/AnswerController.jsx index 62aebdb..fe09960 100644 --- a/client/src/controllers/QAControllers/AnswerController.jsx +++ b/client/src/controllers/QAControllers/AnswerController.jsx @@ -7,12 +7,10 @@ import { } from 'services/questionsServices'; export default function AnswerController({ answer_id, question_id, ...props }) { + const acceptAnswer = () => updateAcceptAnswer(question_id, answer_id); const getVote = () => getAnswerVote(question_id, answer_id); const updateVote = (data) => updateAnswerVote(question_id, answer_id, data); - const postComment = async (data) => { - await postAnswerComment(question_id, answer_id, data); - }; - const acceptAnswer = () => updateAcceptAnswer(question_id, answer_id); + const postComment = async (data) => { await postAnswerComment(question_id, answer_id, data); }; return ( );