-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFlatButton.js
More file actions
28 lines (24 loc) · 744 Bytes
/
Copy pathFlatButton.js
File metadata and controls
28 lines (24 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import React, { PropTypes } from 'react';
import classNames from 'classnames';
import Icon from '../Utils/Icon';
import SmartButton from '../Utils/SmartButton';
import './FlatButton.scss';
const FlatButton = React.createClass({
propTypes: {
color: PropTypes.oneOf(['brand', 'lilac', 'transparent']),
icon: PropTypes.string,
},
render() {
const { color, children, ...props } = this.props;
const className = classNames('FlatButton', {
[`FlatButton--${color}`]: color,
}, this.props.className);
return (
<SmartButton {...props} className={className}>
{this.props.icon ? <Icon name={this.props.icon} /> : null}
{children}
</SmartButton>
);
},
});
export default FlatButton;