diff --git a/components/snackbar/index.js b/components/snackbar/index.js index 691c43be..9ca8a221 100644 --- a/components/snackbar/index.js +++ b/components/snackbar/index.js @@ -8,51 +8,66 @@ export default React.createClass({ displayName: 'Slider', propTypes: { - action: React.PropTypes.object, - active: React.PropTypes.bool, - label: React.PropTypes.string, - className: React.PropTypes.string, + action: React.PropTypes.string, icon: React.PropTypes.string, + label: React.PropTypes.string, + onClick: React.PropTypes.func, timeout: React.PropTypes.number, type: React.PropTypes.string }, - getDefaultProps () { - return { - active: false, - className: '', - timeout: 10 - }; - }, - getInitialState () { return { - active: this.props.active + active: false }; }, - componentDidMount () { - setTimeout(() => { - this.setState({ active: false }); - }, this.props.timeout * 1000) + handleClick (event) { + this.setState({active: false}); + if (this.props.onClick) { + this.props.onClick(event, this); + } }, - componentWillReceiveProps (next_props) { - this.setState({active: next_props.active}); + renderButton () { + if (this.props.action) { + return ( +