aboutsummaryrefslogtreecommitdiffstats
path: root/webui/src/pages/bug/CommentForm.tsx
diff options
context:
space:
mode:
authorCláudio Silva <claudio.engdist@gmail.com>2021-02-05 08:45:11 -0300
committerGitHub <noreply@github.com>2021-02-05 12:45:11 +0100
commit12323b94398daa6cedca36fc2c58a97200092e16 (patch)
tree132a0ac9fc3b02176010b16818178c76130e1931 /webui/src/pages/bug/CommentForm.tsx
parent52f6563495095af13a777b866ea8fea100fd0ff8 (diff)
downloadgit-bug-12323b94398daa6cedca36fc2c58a97200092e16.tar.gz
Webui 548 (#549)
* Commit for #548 * Commit for #548
Diffstat (limited to 'webui/src/pages/bug/CommentForm.tsx')
-rw-r--r--webui/src/pages/bug/CommentForm.tsx11
1 files changed, 10 insertions, 1 deletions
diff --git a/webui/src/pages/bug/CommentForm.tsx b/webui/src/pages/bug/CommentForm.tsx
index 128e4d32..c623dabb 100644
--- a/webui/src/pages/bug/CommentForm.tsx
+++ b/webui/src/pages/bug/CommentForm.tsx
@@ -6,6 +6,7 @@ import { makeStyles, Theme } from '@material-ui/core/styles';
import CommentInput from '../../layout/CommentInput/CommentInput';
import CloseBugButton from 'src/components/CloseBugButton/CloseBugButton';
+import ReopenBugButton from 'src/components/ReopenBugButton/ReopenBugButton';
import { BugFragment } from './Bug.generated';
import { useAddCommentMutation } from './CommentForm.generated';
@@ -83,6 +84,14 @@ function CommentForm({ bug }: Props) {
if (issueComment.length > 0) submit();
};
+ function getCloseButton() {
+ return <CloseBugButton bug={bug} disabled={issueComment.length > 0} />;
+ }
+
+ function getReopenButton() {
+ return <ReopenBugButton bug={bug} disabled={issueComment.length > 0} />;
+ }
+
return (
<Paper className={classes.container}>
<form onSubmit={handleSubmit} ref={form}>
@@ -92,7 +101,7 @@ function CommentForm({ bug }: Props) {
onChange={(comment: string) => setIssueComment(comment)}
/>
<div className={classes.actions}>
- <CloseBugButton bug={bug} disabled={issueComment.length > 0} />
+ {bug.status === 'OPEN' ? getCloseButton() : getReopenButton()}
<Button
className={classes.greenButton}
variant="contained"