1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/public/js/components/feature/Feature.jsx

35 lines
982 B
React
Raw Normal View History

2014-10-30 18:25:38 +01:00
var React = require('react');
2014-11-03 13:54:06 +01:00
var Feature = React.createClass({
2014-10-30 18:25:38 +01:00
onChange: function(event) {
this.props.onChange({
name: this.props.feature.name,
field: 'enabled',
value: event.target.checked
});
},
render: function() {
return (
2014-10-31 10:30:23 +01:00
<div className='line mal'>
2014-11-10 16:21:22 +01:00
<div className='unit r-size1of5'>
2014-10-31 10:30:23 +01:00
<input type='checkbox' checked={this.props.feature.enabled} onChange={this.onChange} />
2014-10-30 18:25:38 +01:00
</div>
2014-10-31 10:30:23 +01:00
2014-11-10 16:21:22 +01:00
<div className='unit r-size1of5'>
2014-10-31 10:30:23 +01:00
{this.props.feature.name}
</div>
2014-11-10 16:21:22 +01:00
<div className='unit r-size2of5 opaque smalltext truncate'>
{this.props.feature.description || '\u00a0'}
</div>
<div className='unit'>
2014-10-30 18:25:38 +01:00
{this.props.feature.strategy}
</div>
</div>
);
}
});
2014-11-03 13:54:06 +01:00
module.exports = Feature;