Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
test material-ui with basic Button component in storybook
  • Loading branch information
drusepth committed Feb 5, 2020
1 parent 3f01bf9 commit 76fb3b4
Show file tree
Hide file tree
Showing 5 changed files with 15,208 additions and 7 deletions.
38 changes: 38 additions & 0 deletions app/javascript/components/Button.js
@@ -0,0 +1,38 @@
import React from "react"
import PropTypes from "prop-types"

import MaterialButton from '@material-ui/core/Button';
import IconButton from '@material-ui/core/IconButton';
import Icon from '@material-ui/core/Icon';

class Button extends React.Component {
render () {
return (
<MaterialButton
color={this.props.color}
variant={this.props.variant}
disabled={this.props.disabled}
size={this.props.size}
disableElevation={!this.props.elevated}
startIcon={<Icon>this.props.startIcon</Icon>}
endIcon={this.props.endIcon}
>
{this.props.label}
</MaterialButton>
);
}
}

Button.propTypes = {
color: PropTypes.string,
variant: PropTypes.string,
size: PropTypes.string,
disabled: PropTypes.bool,
elevated: PropTypes.bool,
startIcon: PropTypes.string,
endIcon: PropTypes.string,
href: PropTypes.string,
label: PropTypes.string,
};

export default Button;

0 comments on commit 76fb3b4

Please sign in to comment.