52 lines
1.0 KiB
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';
import { selectPlugins } from '../App/selectors';
2016-08-19 13:57:50 +02:00
export class Content extends React.Component { // eslint-disable-line react/prefer-stateless-function
render() {
2016-08-23 13:49:15 +02:00
let plugin;
this.props.plugins.map(p => {
plugin = p;
return p;
});
const Elem = plugin.mainComponent;
2016-08-19 13:57:50 +02:00
return (
<div className={styles.content}>
2016-08-24 15:09:42 +02:00
<div className="alert alert-success" role="alert">
<strong>Welcome!</strong> You successfully loaded the admin panel.
</div>
2016-08-23 13:49:15 +02:00
<Elem></Elem>
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,
};
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);