aboutsummaryrefslogtreecommitdiffstats
path: root/webui/src/pages/bug/CommentForm.tsx
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2021-02-05 10:38:38 +0100
committerGitHub <noreply@github.com>2021-02-05 10:38:38 +0100
commit52f6563495095af13a777b866ea8fea100fd0ff8 (patch)
tree461e92c46c5e4ba8fd897b2a808ac52cc57c41ae /webui/src/pages/bug/CommentForm.tsx
parentb6a967efac24672b64d02dbbe6e661d195804fbd (diff)
parentad45f9199898ed4abaf4a8a52421edd727eaa26e (diff)
downloadgit-bug-52f6563495095af13a777b866ea8fea100fd0ff8.tar.gz
Merge pull request #547 from claudioantonio/webui_546
Webui 546
Diffstat (limited to 'webui/src/pages/bug/CommentForm.tsx')
-rw-r--r--webui/src/pages/bug/CommentForm.tsx12
1 files changed, 8 insertions, 4 deletions
diff --git a/webui/src/pages/bug/CommentForm.tsx b/webui/src/pages/bug/CommentForm.tsx
index c39f30c2..128e4d32 100644
--- a/webui/src/pages/bug/CommentForm.tsx
+++ b/webui/src/pages/bug/CommentForm.tsx
@@ -5,7 +5,9 @@ import Paper from '@material-ui/core/Paper';
import { makeStyles, Theme } from '@material-ui/core/styles';
import CommentInput from '../../layout/CommentInput/CommentInput';
+import CloseBugButton from 'src/components/CloseBugButton/CloseBugButton';
+import { BugFragment } from './Bug.generated';
import { useAddCommentMutation } from './CommentForm.generated';
import { TimelineDocument } from './TimelineQuery.generated';
@@ -28,6 +30,7 @@ const useStyles = makeStyles<Theme, StyleProps>((theme) => ({
justifyContent: 'flex-end',
},
greenButton: {
+ marginLeft: '8px',
backgroundColor: '#2ea44fd9',
color: '#fff',
'&:hover': {
@@ -37,10 +40,10 @@ const useStyles = makeStyles<Theme, StyleProps>((theme) => ({
}));
type Props = {
- bugId: string;
+ bug: BugFragment;
};
-function CommentForm({ bugId }: Props) {
+function CommentForm({ bug }: Props) {
const [addComment, { loading }] = useAddCommentMutation();
const [issueComment, setIssueComment] = useState('');
const [inputProp, setInputProp] = useState<any>('');
@@ -51,7 +54,7 @@ function CommentForm({ bugId }: Props) {
addComment({
variables: {
input: {
- prefix: bugId,
+ prefix: bug.id,
message: issueComment,
},
},
@@ -60,7 +63,7 @@ function CommentForm({ bugId }: Props) {
{
query: TimelineDocument,
variables: {
- id: bugId,
+ id: bug.id,
first: 100,
},
},
@@ -89,6 +92,7 @@ function CommentForm({ bugId }: Props) {
onChange={(comment: string) => setIssueComment(comment)}
/>
<div className={classes.actions}>
+ <CloseBugButton bug={bug} disabled={issueComment.length > 0} />
<Button
className={classes.greenButton}
variant="contained"