mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +01:00
Sketch out react events
This commit is contained in:
parent
81168c1a82
commit
ec22a2be03
@ -31,11 +31,16 @@ var FeatureList = React.createClass({
|
|||||||
var featureNodes = [];
|
var featureNodes = [];
|
||||||
|
|
||||||
this.props.unsavedFeatures.forEach(function(feature) {
|
this.props.unsavedFeatures.forEach(function(feature) {
|
||||||
featureNodes.push(<UnsavedFeature feature={feature} />);
|
featureNodes.push(<UnsavedFeature feature={feature} onSubmit={this.props.onFeatureSubmit} />);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.props.savedFeatures.forEach(function(feature) {
|
this.props.savedFeatures.forEach(function(feature) {
|
||||||
featureNodes.push(<SavedFeature key={feature.name} feature={feature} />);
|
featureNodes.push(
|
||||||
|
<SavedFeature
|
||||||
|
key={feature.name}
|
||||||
|
feature={feature}
|
||||||
|
onChange={this.props.onFeatureChange} />
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
return (<div>{featureNodes}</div>);
|
return (<div>{featureNodes}</div>);
|
||||||
@ -66,13 +71,23 @@ var Unleash = React.createClass({
|
|||||||
window.alert(error);
|
window.alert(error);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
updateFeature: function (changeRequest) {
|
||||||
|
console.log(changeRequest);
|
||||||
|
},
|
||||||
|
|
||||||
|
createFeature: function (feature) {
|
||||||
|
console.log(feature);
|
||||||
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Menu />
|
<Menu />
|
||||||
<FeatureList
|
<FeatureList
|
||||||
unsavedFeatures={this.state.unsavedFeatures}
|
unsavedFeatures={this.state.unsavedFeatures}
|
||||||
savedFeatures={this.state.savedFeatures} />
|
savedFeatures={this.state.savedFeatures}
|
||||||
|
onFeatureChanged={this.updateFeature}
|
||||||
|
onFeatureSubmit={this.createFeature} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user