mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-15 02:01:43 +03:00
webui: minor code fixes
This commit is contained in:
parent
0b3acaa321
commit
07e1c45cd7
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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>
|
||||
|
@ -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
|
||||
|
@ -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>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user