1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-23 20:07:40 +02:00
unleash.unleash/frontend/src/component/feature/form/strategies-section.jsx

40 lines
1.0 KiB
React
Raw Normal View History

2016-11-10 14:26:24 +01:00
import React, { PropTypes } from 'react';
import StrategiesList from './strategies-list';
import AddStrategy from './strategies-add';
const headerStyle = {
marginBottom: '10px',
};
class StrategiesSection extends React.Component {
static propTypes () {
return {
strategies: PropTypes.array.isRequired,
addStrategy: PropTypes.func.isRequired,
removeStrategy: PropTypes.func.isRequired,
updateStrategy: PropTypes.func.isRequired,
fetchStrategies: PropTypes.func.isRequired,
};
}
componentWillMount () {
this.props.fetchStrategies();
}
render () {
if (!this.props.strategies || this.props.strategies.length === 0) {
return <i>Loding available strategies</i>;
}
return (
<div>
2016-12-04 13:51:31 +01:00
<h5 style={headerStyle}>Activation strategies <AddStrategy {...this.props} /> </h5>
2016-11-15 23:14:30 +01:00
<StrategiesList {...this.props} />
2016-11-10 14:26:24 +01:00
</div>
);
}
}
export default StrategiesSection;