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() {
|
function isFormValid() {
|
||||||
if (issueTitleInput) {
|
if (issueTitleInput) {
|
||||||
return issueTitleInput.value.length > 0 ? true : false;
|
return issueTitleInput.value.length > 0;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ const useStyles = makeStyles({
|
|||||||
|
|
||||||
const PreTag = (props: React.HTMLProps<HTMLPreElement>) => {
|
const PreTag = (props: React.HTMLProps<HTMLPreElement>) => {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
return <pre className={classes.tag} {...props}></pre>;
|
return <pre className={classes.tag} {...props} />;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default PreTag;
|
export default PreTag;
|
||||||
|
@ -46,7 +46,7 @@ function Header() {
|
|||||||
<img src="/logo.svg" className={classes.logo} alt="git-bug" />
|
<img src="/logo.svg" className={classes.logo} alt="git-bug" />
|
||||||
git-bug
|
git-bug
|
||||||
</Link>
|
</Link>
|
||||||
<div className={classes.filler}></div>
|
<div className={classes.filler} />
|
||||||
<div className={classes.lightSwitch}>
|
<div className={classes.lightSwitch}>
|
||||||
<LightSwitch />
|
<LightSwitch />
|
||||||
</div>
|
</div>
|
||||||
|
@ -40,7 +40,7 @@ function CountingFilter({ query, children, ...props }: CountingFilterProps) {
|
|||||||
variables: { query },
|
variables: { query },
|
||||||
});
|
});
|
||||||
|
|
||||||
var prefix;
|
let prefix;
|
||||||
if (loading) prefix = '...';
|
if (loading) prefix = '...';
|
||||||
else if (error || !data?.repository) prefix = '???';
|
else if (error || !data?.repository) prefix = '???';
|
||||||
// TODO: better prefixes & error handling
|
// TODO: better prefixes & error handling
|
||||||
|
@ -86,7 +86,7 @@ function NewBugPage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function isFormValid() {
|
function isFormValid() {
|
||||||
return issueTitle.length > 0 && issueComment.length > 0 ? true : false;
|
return issueTitle.length > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (loading) return <div>Loading...</div>;
|
if (loading) return <div>Loading...</div>;
|
||||||
@ -119,14 +119,14 @@ function NewBugPage() {
|
|||||||
className={classes.greenButton}
|
className={classes.greenButton}
|
||||||
variant="contained"
|
variant="contained"
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={isFormValid() ? false : true}
|
disabled={!isFormValid()}
|
||||||
>
|
>
|
||||||
Submit new issue
|
Submit new issue
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</Paper>
|
</Paper>
|
||||||
<div className={classes.rightSidebar}></div>
|
<div className={classes.rightSidebar} />
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user