diff options
author | Michael Muré <batolettre@gmail.com> | 2021-03-19 17:04:59 +0100 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2021-03-19 17:04:59 +0100 |
commit | 07e1c45cd70554630640bb1ea25968078a36fd6c (patch) | |
tree | 1b604b88932719d219d941333f38f5209f65945a | |
parent | 0b3acaa3211b1c884bd42f18bf58383343b42bc1 (diff) | |
download | git-bug-07e1c45cd70554630640bb1ea25968078a36fd6c.tar.gz |
webui: minor code fixes
-rw-r--r-- | webui/src/components/BugTitleForm/BugTitleForm.tsx | 2 | ||||
-rw-r--r-- | webui/src/components/Content/PreTag.tsx | 2 | ||||
-rw-r--r-- | webui/src/components/Header/Header.tsx | 2 | ||||
-rw-r--r-- | webui/src/pages/list/FilterToolbar.tsx | 2 | ||||
-rw-r--r-- | webui/src/pages/new/NewBugPage.tsx | 6 |
5 files changed, 7 insertions, 7 deletions
diff --git a/webui/src/components/BugTitleForm/BugTitleForm.tsx b/webui/src/components/BugTitleForm/BugTitleForm.tsx index c31f8ef7..9a161443 100644 --- a/webui/src/components/BugTitleForm/BugTitleForm.tsx +++ b/webui/src/components/BugTitleForm/BugTitleForm.tsx @@ -66,7 +66,7 @@ function BugTitleForm({ bug }: Props) { function isFormValid() { if (issueTitleInput) { - return issueTitleInput.value.length > 0 ? true : false; + return issueTitleInput.value.length > 0; } else { return false; } diff --git a/webui/src/components/Content/PreTag.tsx b/webui/src/components/Content/PreTag.tsx index 5256ab12..8e352153 100644 --- a/webui/src/components/Content/PreTag.tsx +++ b/webui/src/components/Content/PreTag.tsx @@ -11,7 +11,7 @@ const useStyles = makeStyles({ const PreTag = (props: React.HTMLProps<HTMLPreElement>) => { const classes = useStyles(); - return <pre className={classes.tag} {...props}></pre>; + return <pre className={classes.tag} {...props} />; }; export default PreTag; diff --git a/webui/src/components/Header/Header.tsx b/webui/src/components/Header/Header.tsx index 579bf127..3443fcf5 100644 --- a/webui/src/components/Header/Header.tsx +++ b/webui/src/components/Header/Header.tsx @@ -46,7 +46,7 @@ function Header() { <img src="/logo.svg" className={classes.logo} alt="git-bug" /> git-bug </Link> - <div className={classes.filler}></div> + <div className={classes.filler} /> <div className={classes.lightSwitch}> <LightSwitch /> </div> diff --git a/webui/src/pages/list/FilterToolbar.tsx b/webui/src/pages/list/FilterToolbar.tsx index e4cd8e6a..74eefe4c 100644 --- a/webui/src/pages/list/FilterToolbar.tsx +++ b/webui/src/pages/list/FilterToolbar.tsx @@ -40,7 +40,7 @@ function CountingFilter({ query, children, ...props }: CountingFilterProps) { variables: { query }, }); - var prefix; + let prefix; if (loading) prefix = '...'; else if (error || !data?.repository) prefix = '???'; // TODO: better prefixes & error handling diff --git a/webui/src/pages/new/NewBugPage.tsx b/webui/src/pages/new/NewBugPage.tsx index 39725722..f313ac24 100644 --- a/webui/src/pages/new/NewBugPage.tsx +++ b/webui/src/pages/new/NewBugPage.tsx @@ -86,7 +86,7 @@ function NewBugPage() { } function isFormValid() { - return issueTitle.length > 0 && issueComment.length > 0 ? true : false; + return issueTitle.length > 0; } if (loading) return <div>Loading...</div>; @@ -119,14 +119,14 @@ function NewBugPage() { className={classes.greenButton} variant="contained" type="submit" - disabled={isFormValid() ? false : true} + disabled={!isFormValid()} > Submit new issue </Button> </div> </form> </Paper> - <div className={classes.rightSidebar}></div> + <div className={classes.rightSidebar} /> </div> </main> ); |