Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
test material-ui with basic Button component in storybook
- Loading branch information
Showing
5 changed files
with
15,208 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
Oops, something went wrong.