45 lines
921 B
JavaScript
Raw Normal View History

2016-08-19 13:57:50 +02:00
/*
*
* Content
*
*/
import React from 'react';
import { connect } from 'react-redux';
2016-08-24 15:09:42 +02:00
import styles from './styles.scss';
2016-08-23 13:49:15 +02:00
import { createSelector } from 'reselect';
2016-08-26 13:28:12 +02:00
import { selectPlugins } from 'containers/App/selectors';
2016-08-19 13:57:50 +02:00
export class Content extends React.Component { // eslint-disable-line react/prefer-stateless-function
2016-09-02 17:52:42 +02:00
static propTypes = {
children: React.PropTypes.node,
};
2016-08-23 13:49:15 +02:00
2016-09-02 17:52:42 +02:00
render() {
2016-08-19 13:57:50 +02:00
return (
<div className={styles.content}>
2016-09-02 17:52:42 +02:00
{React.Children.toArray(this.props.children)}
2016-08-19 13:57:50 +02:00
</div>
);
}
}
2016-08-23 13:49:15 +02:00
Content.propTypes = {
plugins: React.PropTypes.object,
onRegisterPluginClicked: React.PropTypes.func,
2016-09-02 17:52:42 +02:00
params: React.PropTypes.object,
2016-08-23 13:49:15 +02:00
};
const mapStateToProps = createSelector(
selectPlugins(),
(plugins) => ({ plugins })
);
2016-08-19 13:57:50 +02:00
function mapDispatchToProps(dispatch) {
return {
dispatch,
};
}
2016-08-23 13:49:15 +02:00
export default connect(mapStateToProps, mapDispatchToProps)(Content);