Merge branch 'feat/ui-1.0.3' into 'test'

Feat/ui 1.0.3

See merge request opensource/answer!403
This commit is contained in:
Li Shuailing
2023-01-06 08:05:21 +00:00
2 changed files with 4 additions and 2 deletions
@@ -18,7 +18,7 @@ const Index: FC<Props> = ({ visible, siteUrl = '' }) => {
<p>
<Trans i18nKey="install.ready_description">
If you ever feel like changing more settings, visit
<a href={`${siteUrl}/users/login`}>admin section</a>; find it in the
<a href={`${siteUrl}/users/login`}> admin section</a>; find it in the
site menu.
</Trans>
</p>
@@ -32,6 +32,7 @@ const Index: FC<Props> = ({ visible = false, data, callback }) => {
});
const [showEditor, setShowEditor] = useState<boolean>(visible);
const [focusType, setForceType] = useState('');
const [editorFoucsState, setEditorFoucsState] = useState(false);
const handleSubmit = () => {
if (!formData.content.value) {
@@ -84,6 +85,7 @@ const Index: FC<Props> = ({ visible = false, data, callback }) => {
const handleFocusForTextArea = () => {
setForceType('answer');
setShowEditor(true);
setEditorFoucsState(true);
};
return (
@@ -114,7 +116,7 @@ const Index: FC<Props> = ({ visible = false, data, callback }) => {
focusType === 'answer' && 'focus',
)}
value={formData.content.value}
autoFocus
autoFocus={editorFoucsState}
onChange={(val) => {
setFormData({
content: {