aboutsummaryrefslogtreecommitdiffstats
path: root/webui/src/components/BugTitleForm/BugTitleForm.tsx
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2021-03-29 10:58:10 +0200
committerMichael Muré <batolettre@gmail.com>2021-03-29 11:02:08 +0200
commitaa0449a3eafa42c8c0d44bbdc2b79c5f47bd2d32 (patch)
treecd0c72a0229bb38cf8096ce198384cdd972f66e2 /webui/src/components/BugTitleForm/BugTitleForm.tsx
parent5215634d0dca37c545904fbc8a12ddd9b8eb72df (diff)
parente985653701e8438e27ee5f925fd0aa7c0eef09fe (diff)
downloadgit-bug-aa0449a3eafa42c8c0d44bbdc2b79c5f47bd2d32.tar.gz
Merge remote-tracking branch 'origin/master' into dag-entity
Diffstat (limited to 'webui/src/components/BugTitleForm/BugTitleForm.tsx')
-rw-r--r--webui/src/components/BugTitleForm/BugTitleForm.tsx42
1 files changed, 14 insertions, 28 deletions
diff --git a/webui/src/components/BugTitleForm/BugTitleForm.tsx b/webui/src/components/BugTitleForm/BugTitleForm.tsx
index c47eab31..a7d5a820 100644
--- a/webui/src/components/BugTitleForm/BugTitleForm.tsx
+++ b/webui/src/components/BugTitleForm/BugTitleForm.tsx
@@ -1,12 +1,6 @@
import React, { useState } from 'react';
-import {
- Button,
- fade,
- makeStyles,
- TextField,
- Typography,
-} from '@material-ui/core';
+import { Button, makeStyles, Typography } from '@material-ui/core';
import { TimelineDocument } from '../../pages/bug/TimelineQuery.generated';
import IfLoggedIn from '../IfLoggedIn/IfLoggedIn';
@@ -14,6 +8,7 @@ import Author from 'src/components/Author';
import Date from 'src/components/Date';
import { BugFragment } from 'src/pages/bug/Bug.generated';
+import BugTitleInput from './BugTitleInput';
import { useSetTitleMutation } from './SetTitle.generated';
/**
@@ -45,26 +40,16 @@ const useStyles = makeStyles((theme) => ({
marginLeft: theme.spacing(2),
},
greenButton: {
- marginLeft: '8px',
- backgroundColor: '#2ea44fd9',
- color: '#fff',
+ marginLeft: theme.spacing(1),
+ backgroundColor: theme.palette.success.main,
+ color: theme.palette.success.contrastText,
'&:hover': {
- backgroundColor: '#2ea44f',
+ backgroundColor: theme.palette.success.dark,
+ color: theme.palette.primary.contrastText,
},
},
- titleInput: {
- borderRadius: theme.shape.borderRadius,
- borderColor: fade(theme.palette.primary.main, 0.2),
- borderStyle: 'solid',
- borderWidth: '1px',
- backgroundColor: fade(theme.palette.primary.main, 0.05),
- padding: theme.spacing(0, 0),
- minWidth: 336,
- transition: theme.transitions.create([
- 'width',
- 'borderColor',
- 'backgroundColor',
- ]),
+ saveButton: {
+ marginRight: theme.spacing(1),
},
}));
@@ -85,7 +70,7 @@ function BugTitleForm({ bug }: Props) {
function isFormValid() {
if (issueTitleInput) {
- return issueTitleInput.value.length > 0 ? true : false;
+ return issueTitleInput.value.length > 0;
} else {
return false;
}
@@ -122,11 +107,11 @@ function BugTitleForm({ bug }: Props) {
function editableBugTitle() {
return (
<form className={classes.headerTitle} onSubmit={submitNewTitle}>
- <TextField
+ <BugTitleInput
inputRef={(node) => {
issueTitleInput = node;
}}
- className={classes.titleInput}
+ label="Title"
variant="outlined"
fullWidth
margin="dense"
@@ -135,6 +120,7 @@ function BugTitleForm({ bug }: Props) {
/>
<div className={classes.editButtonContainer}>
<Button
+ className={classes.saveButton}
size="small"
variant="contained"
type="submit"
@@ -173,7 +159,7 @@ function BugTitleForm({ bug }: Props) {
variant="contained"
href="/new"
>
- New issue
+ New bug
</Button>
</div>
)}