From d79ef7a7945ba82caeec62cad44dad134c9edfbc Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Wed, 10 Apr 2019 21:19:45 +0200 Subject: webui: Migrate to Material-UI's new style API --- webui/src/list/BugRow.js | 67 +++++++++++++++++++++++++----------------------- 1 file changed, 35 insertions(+), 32 deletions(-) (limited to 'webui/src/list/BugRow.js') diff --git a/webui/src/list/BugRow.js b/webui/src/list/BugRow.js index a045770b..e82d81db 100644 --- a/webui/src/list/BugRow.js +++ b/webui/src/list/BugRow.js @@ -1,4 +1,4 @@ -import { withStyles } from '@material-ui/core/styles'; +import { makeStyles } from '@material-ui/styles'; import TableCell from '@material-ui/core/TableCell/TableCell'; import TableRow from '@material-ui/core/TableRow/TableRow'; import Tooltip from '@material-ui/core/Tooltip/Tooltip'; @@ -33,7 +33,7 @@ const Status = ({ status, className }) => { } }; -const styles = theme => ({ +const useStyles = makeStyles(theme => ({ cell: { display: 'flex', alignItems: 'center', @@ -53,36 +53,39 @@ const styles = theme => ({ labels: { paddingLeft: theme.spacing.unit, }, -}); +})); -const BugRow = ({ bug, classes }) => ( - - - -
- -
- - {bug.title} - - {bug.labels.length > 0 && ( - - {bug.labels.map(l => ( - - )} -
- - - {bug.humanId} opened - - by {bug.author.displayName} - -
-
-
-); +function BugRow({ bug }) { + const classes = useStyles(); + return ( + + + +
+ +
+ + {bug.title} + + {bug.labels.length > 0 && ( + + {bug.labels.map(l => ( + + )} +
+ + + {bug.humanId} opened + + by {bug.author.displayName} + +
+
+
+ ); +} BugRow.fragment = gql` fragment BugRow on Bug { @@ -99,4 +102,4 @@ BugRow.fragment = gql` } `; -export default withStyles(styles)(BugRow); +export default BugRow; -- cgit