mirror of
https://github.com/strapi/strapi.git
synced 2025-08-05 15:29:04 +00:00
55 lines
1.1 KiB
JavaScript
55 lines
1.1 KiB
JavaScript
/*
|
|
*
|
|
* 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
|
|
|
|
static propTypes = {
|
|
children: React.PropTypes.node,
|
|
};
|
|
|
|
render() {
|
|
const containers = this.props.plugins.valueSeq().map((plugin, i) => {
|
|
const Elem = plugin.mainComponent;
|
|
return <Elem key={i} {...this.props}></Elem>;
|
|
});
|
|
|
|
return (
|
|
<div>
|
|
<Helmet
|
|
title="Strapi - Plugin"
|
|
meta={[
|
|
{ name: 'description', content: 'Description of PluginPage' },
|
|
]}
|
|
/>
|
|
{containers}
|
|
</div>
|
|
);
|
|
}
|
|
}
|
|
|
|
PluginPage.propTypes = {
|
|
plugins: React.PropTypes.object,
|
|
};
|
|
|
|
const mapStateToProps = createSelector(
|
|
selectPlugins(),
|
|
(plugins) => ({ plugins })
|
|
);
|
|
|
|
function mapDispatchToProps(dispatch) {
|
|
return {
|
|
dispatch,
|
|
};
|
|
}
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(PluginPage);
|