aboutsummaryrefslogtreecommitdiffstats
path: root/webui/src/pages/new
diff options
context:
space:
mode:
authorQuentin Gliech <quentingliech@gmail.com>2022-02-22 21:50:14 +0100
committerQuentin Gliech <quentingliech@gmail.com>2022-02-22 21:50:14 +0100
commitfd17d6dd1f7c9fbda4d3c3e2c2eb232bd9086fab (patch)
tree436108fbaa0d386b642768a90e90c1ad33d6fad2 /webui/src/pages/new
parentb0eb041e571dd616a9926d969bb42b3e7d6512e9 (diff)
downloadgit-bug-fd17d6dd1f7c9fbda4d3c3e2c2eb232bd9086fab.tar.gz
webui: upgrade Material UI
Diffstat (limited to 'webui/src/pages/new')
-rw-r--r--webui/src/pages/new/NewBugPage.tsx21
1 files changed, 11 insertions, 10 deletions
diff --git a/webui/src/pages/new/NewBugPage.tsx b/webui/src/pages/new/NewBugPage.tsx
index 3ab2a92a..0852ef39 100644
--- a/webui/src/pages/new/NewBugPage.tsx
+++ b/webui/src/pages/new/NewBugPage.tsx
@@ -1,9 +1,9 @@
-import { FormEvent, useState } from 'react';
+import { Button, Paper } from '@mui/material';
+import { Theme } from '@mui/material/styles';
+import makeStyles from '@mui/styles/makeStyles';
+import { FormEvent, useRef, useState } from 'react';
import { useNavigate } from 'react-router-dom';
-import { Button, Paper } from '@material-ui/core';
-import { makeStyles, Theme } from '@material-ui/core/styles';
-
import BugTitleInput from '../../components/BugTitleForm/BugTitleInput';
import CommentInput from '../../components/CommentInput/CommentInput';
@@ -48,8 +48,8 @@ function NewBugPage() {
const [issueComment, setIssueComment] = useState('');
const classes = useStyles();
- let issueTitleInput: any;
- let navigate = useNavigate();
+ const issueTitleInput = useRef<HTMLInputElement>(null);
+ const navigate = useNavigate();
function submitNewIssue(e: FormEvent) {
e.preventDefault();
@@ -65,7 +65,10 @@ function NewBugPage() {
const id = data.data?.newBug.bug.id;
navigate('/bug/' + id);
});
- issueTitleInput.value = '';
+
+ if (issueTitleInput.current) {
+ issueTitleInput.current.value = '';
+ }
}
function isFormValid() {
@@ -79,9 +82,7 @@ function NewBugPage() {
<Paper className={classes.main}>
<form className={classes.form} onSubmit={submitNewIssue}>
<BugTitleInput
- inputRef={(node) => {
- issueTitleInput = node;
- }}
+ inputRef={issueTitleInput}
label="Title"
variant="outlined"
fullWidth