material-ui
Advanced tools
Comparing version 0.1.2 to 0.1.21
@@ -1,11 +0,10 @@ | ||
/** | ||
* @jsx React.DOM | ||
*/ | ||
/** @jsx React.DOM */ | ||
var React = require('react'); | ||
var Classable = require('./mixins/classable.js'); | ||
var ClickAwayable = require('./mixins/click-awayable.js'); | ||
var Toast = React.createClass({ | ||
mixins: [Classable], | ||
mixins: [Classable, ClickAwayable], | ||
@@ -16,3 +15,4 @@ propTypes: { | ||
message: React.PropTypes.string, | ||
onClick: React.PropTypes.func | ||
onClick: React.PropTypes.func, | ||
open: React.PropTypes.bool | ||
}, | ||
@@ -26,17 +26,27 @@ | ||
componentWillReceiveProps: function(nextProps) { | ||
this.setState({ open: nextProps.open }); | ||
}, | ||
componentClickAway: function() { | ||
this.setState({ open: false }); | ||
}, | ||
render: function() { | ||
var classes = this.getClasses('mui-toast', { | ||
'mui-open': this.state.open | ||
}), | ||
message, | ||
action; | ||
var classes = this.getClasses('mui-toast', { | ||
'mui-open': this.state.open | ||
}), | ||
message, | ||
action; | ||
if (this.props.message) message = <span className="mui-toast-message">{this.props.message}</span>; | ||
if (this.props.action) action = <span className="mui-toast-action" onClick={this._onActionClick}>{this.props.action}</span>; | ||
if (this.props.message) | ||
message = <span className="mui-toast-message">{this.props.message}</span>; | ||
if (this.props.action) | ||
action = <span className="mui-toast-action" onClick={this._onActionClick}>{this.props.action}</span>; | ||
return ( | ||
<span className={classes}> | ||
{message} | ||
{action} | ||
</span> | ||
{message} | ||
{action} | ||
</span> | ||
); | ||
@@ -47,15 +57,3 @@ }, | ||
if (this.props.onClick) this.props.onClick(e, this.props.action); | ||
if (this.props.action === 'retry') { | ||
} | ||
else { | ||
this.setState({ open: false }); | ||
} | ||
}, | ||
toggle: function(e) { | ||
this.setState({ open: !this.state.open }); | ||
console.log(!this.state.open); | ||
this.setState({ open: false }); | ||
} | ||
@@ -65,2 +63,2 @@ | ||
module.exports = Toast; | ||
module.exports = Toast; |
{ | ||
"name": "material-ui", | ||
"author": "Call-em-all Engineering Team", | ||
"version": "0.1.2", | ||
"version": "0.1.21", | ||
"description": "Material Design UI components built with React", | ||
@@ -6,0 +6,0 @@ "main": "index.js", |
@@ -5,1 +5,3 @@ material-ui | ||
Material Design UI Components built with React | ||
[Demo](http://callemall.github.io/material-ui/) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
211069
3054
7