diff --git a/i18n/en_US.yaml b/i18n/en_US.yaml index 3a223611..63bdb965 100644 --- a/i18n/en_US.yaml +++ b/i18n/en_US.yaml @@ -1222,7 +1222,7 @@ ui: btn_submit: Save not_found_props: "Required property {{ key }} not found." page_review: - review: Reivew + review: Review proposed: proposed question_edit: Question edit answer_edit: Answer edit diff --git a/ui/src/pages/Questions/Ask/index.tsx b/ui/src/pages/Questions/Ask/index.tsx index 6b2dca45..6bd338e5 100644 --- a/ui/src/pages/Questions/Ask/index.tsx +++ b/ui/src/pages/Questions/Ask/index.tsx @@ -60,6 +60,11 @@ const Ask = () => { const [formData, setFormData] = useState(initFormData); const [checked, setCheckState] = useState(false); const [focusType, setForceType] = useState(''); + const resetForm = () => { + setFormData(initFormData); + setCheckState(false); + setForceType(''); + }; const editorRef = useRef({ getHtml: () => '', @@ -75,7 +80,11 @@ const Ask = () => { const { data: similarQuestions = { list: [] } } = useQueryQuestionByTitle( isEdit ? '' : formData.title.value, ); - + useEffect(() => { + if (!isEdit) { + resetForm(); + } + }, [isEdit]); const { data: revisions = [] } = useQueryRevisions(qid); useEffect(() => { diff --git a/ui/src/pages/Review/index.tsx b/ui/src/pages/Review/index.tsx index 3fce7ac5..132d433d 100644 --- a/ui/src/pages/Review/index.tsx +++ b/ui/src/pages/Review/index.tsx @@ -3,7 +3,13 @@ import { Container, Row, Col, Alert, Stack, Button } from 'react-bootstrap'; import { Link } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; -import { BaseUserCard, FormatTime, Empty, DiffContent } from '@/components'; +import { + BaseUserCard, + FormatTime, + Empty, + DiffContent, + PageTitle, +} from '@/components'; import { getReviewList, revisionAudit } from '@/services'; import { pathFactory } from '@/router/pathFactory'; import type * as Type from '@/common/interface'; @@ -119,6 +125,7 @@ const Index: FC = () => { }, []); return ( +

{t('review')}