fix tooltip null title
This commit is contained in:
parent
986b303576
commit
d858b29286
7 changed files with 24 additions and 9 deletions
|
|
@ -14,7 +14,7 @@ export default function CommentControl({
|
|||
return (
|
||||
<span>
|
||||
<ButtonGroup style={{ alignItems: 'center' }}>
|
||||
<Tooltip title={!canComment && "You must be level 3 to comment or level 5 if this question is protected"}>
|
||||
<Tooltip title={canComment ? '' : 'You must be level 3 to comment or level 5 if this question is protected'}>
|
||||
<span>
|
||||
<Button
|
||||
disabled={!canComment}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
import { Button, Card, CardContent, Tooltip } from "@mui/material"
|
||||
import { AnswerForm } from "controllers/FormControllers"
|
||||
import { useState } from "react"
|
||||
import MdPreview from "./MdPreview"
|
||||
import { useState } from 'react'
|
||||
|
||||
import { useQuestion, useUser } from 'contexts';
|
||||
import { AnswerForm } from 'controllers/FormControllers'
|
||||
import MdPreview from 'components/MdPreview'
|
||||
|
||||
export default function CreateAnswer({ canAnswer, question_id }) {
|
||||
const [show, setShow] = useState(false)
|
||||
|
||||
|
|
@ -11,7 +14,7 @@ export default function CreateAnswer({ canAnswer, question_id }) {
|
|||
}
|
||||
return (
|
||||
<div>
|
||||
<Tooltip title={canAnswer && 'You need to be authenticated to answer or level 5 if the question is protected'}>
|
||||
<Tooltip title={canAnswer ? '' : 'You need to be authenticated to answer or level 5 if the question is protected'}>
|
||||
<span>
|
||||
<Button disabled={!canAnswer} variant="contained" onClick={toggleShow}>Add Answer</Button>
|
||||
</span>
|
||||
|
|
@ -12,9 +12,9 @@ import ReactMarkdown from 'react-markdown';
|
|||
import { Link } from 'react-router-dom';
|
||||
|
||||
import { CreationInfoTag } from 'controllers';
|
||||
import { CommentControl, VoteControl } from 'controllers/QAControllers';
|
||||
import { CommentControl, CreateAnswer, VoteControl } from 'controllers/QAControllers';
|
||||
import { useUser } from 'contexts';
|
||||
import CreateAnswer from 'components/CreateAnswer';
|
||||
|
||||
import {
|
||||
getQuestionVote,
|
||||
postQuestionComment,
|
||||
|
|
@ -143,7 +143,7 @@ export default function Question({
|
|||
Ask question
|
||||
</Button>
|
||||
|
||||
<Tooltip title={!close && 'You must be level 7'}>
|
||||
<Tooltip title={close ? '' : 'You must be level 7'}>
|
||||
<span>
|
||||
<Button
|
||||
disabled={!close}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ export default function VoteControl({
|
|||
}) {
|
||||
|
||||
return (
|
||||
<Tooltip title={!canVote && "This question must be open and you must be level 2 to vote"}>
|
||||
<Tooltip title={canVote ? '': 'This question must be open and you must be level 2 to vote'}>
|
||||
<span style={{ marginRight: 8 }}>
|
||||
<ButtonGroup {...{ orientation, style: { alignItems: 'center' } }}>
|
||||
<IconButton
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import Answer from './Answer';
|
|||
import AnswerComment from './AnswerComment';
|
||||
import Comment from './Comment';
|
||||
import CommentControl from './CommentControl';
|
||||
import CreateAnswer from './CreateAnswer';
|
||||
import Question from './Question';
|
||||
import VoteControl from './VoteControl';
|
||||
|
||||
|
|
@ -10,6 +11,7 @@ export {
|
|||
AnswerComment,
|
||||
Comment,
|
||||
CommentControl,
|
||||
CreateAnswer,
|
||||
Question,
|
||||
VoteControl
|
||||
};
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
import { CreateAnswer } from 'components/QAComponents';
|
||||
|
||||
export default function CommentControlController() {
|
||||
|
||||
return CreateAnswer({
|
||||
|
||||
});
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
import { AnswersList, AnswerCommentsList, CommentsList } from './QAPaginatedListController';
|
||||
import CommentControl from './CommentControlController';
|
||||
import CreateAnswer from './CreateAnswerController';
|
||||
import Question from './QuestionController';
|
||||
import VoteControl from './VoteControlController';
|
||||
|
||||
|
|
@ -8,6 +9,7 @@ export {
|
|||
AnswerCommentsList,
|
||||
CommentControl,
|
||||
CommentsList,
|
||||
CreateAnswer,
|
||||
Question,
|
||||
VoteControl
|
||||
};
|
||||
|
|
|
|||
Reference in a new issue