diff options
author | Cláudio <claudio.engdist@gmail.com> | 2021-02-08 22:58:15 -0300 |
---|---|---|
committer | Cláudio <claudio.engdist@gmail.com> | 2021-02-08 22:58:15 -0300 |
commit | 7829db8850643b6ad2b36f8747d01f66df9024d8 (patch) | |
tree | 1546feb8ec1342c5d7250dd1a84ade4d08da3427 /webui/src/components | |
parent | e47052bd3a02ff6e392c82e3ed3695cf5cf1fa2b (diff) | |
download | git-bug-7829db8850643b6ad2b36f8747d01f66df9024d8.tar.gz |
Commit for #543
- To test I forced Ifloggedin always return null.
- Layout is ok even when edition components are hidden.
Diffstat (limited to 'webui/src/components')
-rw-r--r-- | webui/src/components/BugTitleForm/BugTitleForm.tsx | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/webui/src/components/BugTitleForm/BugTitleForm.tsx b/webui/src/components/BugTitleForm/BugTitleForm.tsx index 16441c93..c47eab31 100644 --- a/webui/src/components/BugTitleForm/BugTitleForm.tsx +++ b/webui/src/components/BugTitleForm/BugTitleForm.tsx @@ -9,6 +9,7 @@ import { } from '@material-ui/core'; import { TimelineDocument } from '../../pages/bug/TimelineQuery.generated'; +import IfLoggedIn from '../IfLoggedIn/IfLoggedIn'; import Author from 'src/components/Author'; import Date from 'src/components/Date'; import { BugFragment } from 'src/pages/bug/Bug.generated'; @@ -156,23 +157,27 @@ function BugTitleForm({ bug }: Props) { <span className={classes.readOnlyTitle}>{bug.title}</span> <span className={classes.readOnlyId}>{bug.humanId}</span> </div> - <div className={classes.editButtonContainer}> - <Button - size="small" - variant="contained" - onClick={() => setbugTitleEdition(!bugTitleEdition)} - > - Edit - </Button> - <Button - className={classes.greenButton} - size="small" - variant="contained" - href="/new" - > - New issue - </Button> - </div> + <IfLoggedIn> + {() => ( + <div className={classes.editButtonContainer}> + <Button + size="small" + variant="contained" + onClick={() => setbugTitleEdition(!bugTitleEdition)} + > + Edit + </Button> + <Button + className={classes.greenButton} + size="small" + variant="contained" + href="/new" + > + New issue + </Button> + </div> + )} + </IfLoggedIn> </div> ); } |