webui: minor code fixes

This commit is contained in:
Michael Muré 2021-03-19 17:04:59 +01:00
parent 0b3acaa321
commit 07e1c45cd7
5 changed files with 7 additions and 7 deletions

View File

@ -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;
}

View File

@ -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;

View File

@ -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>

View File

@ -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

View File

@ -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>
);