55 lines
1.1 KiB
JavaScript
Raw Normal View History

2016-09-02 17:53:01 +02:00
/*
*
* PluginPage
*
*/
import React from 'react';
import { connect } from 'react-redux';
import Helmet from 'react-helmet';
import { createSelector } from 'reselect';
import { selectPlugins } from 'containers/App/selectors';
export class PluginPage extends React.Component { // eslint-disable-line react/prefer-stateless-function
2016-09-06 16:59:56 +02:00
static propTypes = {
children: React.PropTypes.node,
};
2016-09-02 17:53:01 +02:00
2016-09-06 16:59:56 +02:00
render() {
2016-09-09 11:21:54 +02:00
const containers = this.props.plugins.valueSeq().map((plugin, i) => {
const Elem = plugin.mainComponent;
return <Elem key={i} {...this.props}></Elem>;
});
2016-09-02 17:53:01 +02:00
return (
<div>
<Helmet
title="Strapi - Plugin"
meta={[
{ name: 'description', content: 'Description of PluginPage' },
]}
/>
2016-09-09 11:21:54 +02:00
{containers}
2016-09-02 17:53:01 +02:00
</div>
);
}
}
2016-09-05 15:28:06 +02:00
PluginPage.propTypes = {
plugins: React.PropTypes.object,
};
2016-09-02 17:53:01 +02:00
const mapStateToProps = createSelector(
selectPlugins(),
(plugins) => ({ plugins })
);
function mapDispatchToProps(dispatch) {
return {
dispatch,
};
}
export default connect(mapStateToProps, mapDispatchToProps)(PluginPage);