Skip to content

Commit

Permalink
feat(main-policy-resources): add content type - INNO-1879 (#1375)
Browse files Browse the repository at this point in the history
* add content type

* update

* small fixes
  • Loading branch information
emeryro authored and yhuard committed Nov 8, 2019
1 parent 5b74d42 commit d2e1cbd
Show file tree
Hide file tree
Showing 12 changed files with 600 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/* eslint-disable import/no-extraneous-dependencies */
import React from 'react';
import PropTypes from 'prop-types';

import getData from '@ecl/ec-specs-main-policy-resources-page/demo/data';

import MainPolicyResourcesPage from '../src/MainPolicyResourcesPage';

class MainPolicyResourcesExample extends React.Component {
constructor(props) {
super(props);
this.components = null;
}

componentDidMount() {
if (!window.ECL) return;
this.components = window.ECL.autoInit();
}

componentDidUpdate() {
if (!window.ECL) return;

if (this.components) {
this.components.forEach(c => c.destroy());
}

this.components = window.ECL.autoInit();
}

componentWillUnmount() {
if (!window.ECL) return;

if (this.components) {
this.components.forEach(c => c.destroy());
}
}

render() {
const { template } = this.props;
const data = getData(template);

return (
<MainPolicyResourcesPage
siteHeader={data.siteHeader}
footer={data.footer}
template={template}
/>
);
}
}

MainPolicyResourcesExample.propTypes = {
template: PropTypes.string.isRequired,
};

export default MainPolicyResourcesExample;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default from './src/MainPolicyResourcesPage';
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"private": true,
"name": "@ecl/ec-react-main-policy-resources-page",
"author": "European Commission",
"license": "EUPL-1.1",
"version": "2.13.0",
"description": "ECL EC React Main Policy Resources Page",
"main": "index.js",
"module": "index.js",
"dependencies": {
"@ecl/ec-react-component-breadcrumb-core": "^2.13.0",
"@ecl/ec-react-component-breadcrumb-harmonised": "^2.13.0",
"@ecl/ec-react-component-breadcrumb-standardised": "^2.13.0",
"@ecl/ec-react-component-file": "^2.13.0",
"@ecl/ec-react-component-footer-core": "^2.13.0",
"@ecl/ec-react-component-footer-harmonised": "^2.13.0",
"@ecl/ec-react-component-footer-standardised": "^2.13.0",
"@ecl/ec-react-component-link": "^2.13.0",
"@ecl/ec-react-component-page-header-core": "^2.13.0",
"@ecl/ec-react-component-page-header-harmonised": "^2.13.0",
"@ecl/ec-react-component-page-header-standardised": "^2.13.0",
"@ecl/ec-react-component-site-header-core": "^2.13.0",
"@ecl/ec-react-component-site-header-harmonised": "^2.13.0",
"@ecl/ec-react-component-site-header-standardised": "^2.13.0",
"@ecl/ec-react-component-social-media-share": "^2.13.0"
},
"devDependencies": {
"@ecl/ec-layout-grid": "^2.13.0",
"@ecl/ec-specs-main-policy-resources-page": "^2.13.0",
"@ecl/ec-utility-display": "^2.13.0",
"@ecl/ec-utility-flex": "^2.13.0",
"@ecl/ec-utility-spacing": "^2.13.0",
"@ecl/ec-utility-typography": "^2.13.0"
},
"peerDependencies": {
"classnames": "^2.2.6",
"prop-types": "^15.6.2",
"react": "^16.4.2",
"react-dom": "^16.4.2"
}
}
Loading

0 comments on commit d2e1cbd

Please sign in to comment.