summaryrefslogtreecommitdiffstatshomepage
path: root/webui/src/Label.js
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2019-05-22 20:09:29 +0200
committerGitHub <noreply@github.com>2019-05-22 20:09:29 +0200
commite781d6c7fe7dba2fc526c2049aa188c9988e1cf4 (patch)
tree5d51b4fbf5c6dfd8439d01e4a900f074bf8d9ac1 /webui/src/Label.js
parent1a7ccd594adc6f185115ce12a4368c55ff418678 (diff)
parenta43c7ea1c8caa61fa92bf384cd7436476fcb2b0b (diff)
downloadgit-bug-e781d6c7fe7dba2fc526c2049aa188c9988e1cf4.tar.gz
git-bug-e781d6c7fe7dba2fc526c2049aa188c9988e1cf4.zip
Merge pull request #148 from MichaelMure/sandhose/webui-update-deps
Updates WebUI dependencies & rework the bug list pagination
Diffstat (limited to 'webui/src/Label.js')
-rw-r--r--webui/src/Label.js21
1 files changed, 12 insertions, 9 deletions
diff --git a/webui/src/Label.js b/webui/src/Label.js
index e7c25c23..826d21f5 100644
--- a/webui/src/Label.js
+++ b/webui/src/Label.js
@@ -1,5 +1,5 @@
import React from 'react';
-import { withStyles } from '@material-ui/core/styles';
+import { makeStyles } from '@material-ui/styles';
import {
getContrastRatio,
darken,
@@ -42,7 +42,7 @@ const _genStyle = background => ({
// Generate a style object (text, background and border colors) from the label
const genStyle = label => _genStyle(getColor(label));
-const styles = theme => ({
+const useStyles = makeStyles(theme => ({
label: {
...theme.typography.body2,
padding: '0 6px',
@@ -53,12 +53,15 @@ const styles = theme => ({
borderBottom: 'solid 1.5px',
verticalAlign: 'bottom',
},
-});
+}));
-const Label = ({ label, classes }) => (
- <span className={classes.label} style={genStyle(label)}>
- {label}
- </span>
-);
+function Label({ label }) {
+ const classes = useStyles();
+ return (
+ <span className={classes.label} style={genStyle(label)}>
+ {label}
+ </span>
+ );
+}
-export default withStyles(styles)(Label);
+export default Label;