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/bug/Bug.js | 65 +++++++++++++++++++++++++++------------------------- 1 file changed, 34 insertions(+), 31 deletions(-) (limited to 'webui/src/bug/Bug.js') diff --git a/webui/src/bug/Bug.js b/webui/src/bug/Bug.js index 9b5f84ad..829a4af2 100644 --- a/webui/src/bug/Bug.js +++ b/webui/src/bug/Bug.js @@ -1,4 +1,4 @@ -import { withStyles } from '@material-ui/core/styles'; +import { makeStyles } from '@material-ui/styles'; import Typography from '@material-ui/core/Typography/Typography'; import gql from 'graphql-tag'; import React from 'react'; @@ -7,7 +7,7 @@ import Date from '../Date'; import TimelineQuery from './TimelineQuery'; import Label from '../Label'; -const styles = theme => ({ +const useStyles = makeStyles(theme => ({ main: { maxWidth: 800, margin: 'auto', @@ -48,38 +48,41 @@ const styles = theme => ({ display: 'block', }, }, -}); +})); -const Bug = ({ bug, classes }) => ( -
-
- {bug.title} - {bug.humanId} +function Bug({ bug }) { + const classes = useStyles(); + return ( +
+
+ {bug.title} + {bug.humanId} - - - {' opened this bug '} - - -
- -
-
- + + + {' opened this bug '} + +
-
- Labels -
    - {bug.labels.map(l => ( -
  • -
  • - ))} -
+ +
+
+ +
+
+ Labels +
    + {bug.labels.map(l => ( +
  • +
  • + ))} +
+
-
-
-); +
+ ); +} Bug.fragment = gql` fragment Bug on Bug { @@ -97,4 +100,4 @@ Bug.fragment = gql` } `; -export default withStyles(styles)(Bug); +export default Bug; -- cgit