Skip to content

Commit

Permalink
- Badge now has hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
einazare committed Aug 13, 2019
1 parent 4c18042 commit 72a9e9f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/components/Badge/Badge.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ import React from "react";
import PropTypes from "prop-types";

// @material-ui/core components
import withStyles from "@material-ui/core/styles/withStyles";
import { makeStyles } from "@material-ui/core/styles";

import badgeStyle from "assets/jss/material-kit-react/components/badgeStyle.js";
import styles from "assets/jss/material-kit-react/components/badgeStyle.js";

function Badge({ ...props }) {
const { classes, color, children } = props;
const useStyles = makeStyles(styles);

export default function Badge(props) {
const classes = useStyles();
const { color, children } = props;
return (
<span className={classes.badge + " " + classes[color]}>{children}</span>
);
Expand All @@ -31,5 +34,3 @@ Badge.propTypes = {
]),
children: PropTypes.node
};

export default withStyles(badgeStyle)(Badge);

0 comments on commit 72a9e9f

Please sign in to comment.