diff options
author | Quentin Gliech <quentingliech@gmail.com> | 2019-04-10 21:19:45 +0200 |
---|---|---|
committer | Quentin Gliech <quentingliech@gmail.com> | 2019-05-22 19:52:01 +0200 |
commit | d79ef7a7945ba82caeec62cad44dad134c9edfbc (patch) | |
tree | 392d9ceaead2a5780862ecf89cf1cc2a0c550ed7 /webui/src/bug/LabelChange.js | |
parent | 1a7ccd594adc6f185115ce12a4368c55ff418678 (diff) | |
download | git-bug-d79ef7a7945ba82caeec62cad44dad134c9edfbc.tar.gz |
webui: Migrate to Material-UI's new style API
Diffstat (limited to 'webui/src/bug/LabelChange.js')
-rw-r--r-- | webui/src/bug/LabelChange.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/webui/src/bug/LabelChange.js b/webui/src/bug/LabelChange.js index 6301f35f..76b6e6e2 100644 --- a/webui/src/bug/LabelChange.js +++ b/webui/src/bug/LabelChange.js @@ -1,11 +1,11 @@ -import { withStyles } from '@material-ui/core/styles'; +import { makeStyles } from '@material-ui/styles'; import gql from 'graphql-tag'; import React from 'react'; import Author from '../Author'; import Date from '../Date'; import Label from '../Label'; -const styles = theme => ({ +const useStyles = makeStyles(theme => ({ main: { ...theme.typography.body2, marginLeft: theme.spacing.unit + 40, @@ -13,10 +13,11 @@ const styles = theme => ({ author: { fontWeight: 'bold', }, -}); +})); -const LabelChange = ({ op, classes }) => { +function LabelChange({ op }) { const { added, removed } = op; + const classes = useStyles(); return ( <div className={classes.main}> <Author author={op.author} className={classes.author} /> @@ -37,7 +38,7 @@ const LabelChange = ({ op, classes }) => { <Date date={op.date} /> </div> ); -}; +} LabelChange.fragment = gql` fragment LabelChange on TimelineItem { @@ -54,4 +55,4 @@ LabelChange.fragment = gql` } `; -export default withStyles(styles)(LabelChange); +export default LabelChange; |