Skip to content

Commit

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

* update content type

* update content type

* fix ct and update border utilities

* fix sizes

* update

* fix sizes

* small fixes
  • Loading branch information
emeryro authored and yhuard committed Nov 8, 2019
1 parent 46ce224 commit 8f37d83
Show file tree
Hide file tree
Showing 13 changed files with 1,566 additions and 126 deletions.
16 changes: 8 additions & 8 deletions .size-limit.json
Expand Up @@ -6,12 +6,12 @@
{
"path": "dist/packages/ec-preset-full/styles/ecl-ec-preset-full.css",
"webpack": false,
"limit": "22 KB"
"limit": "23 KB"
},
{
"path": "dist/packages/ec-preset-full/styles/ecl-ec-preset-full-print.css",
"webpack": false,
"limit": "10 KB"
"limit": "11 KB"
},
{
"path": "dist/packages/ec-preset-legacy/scripts/ecl-ec-preset-legacy.js",
Expand All @@ -20,12 +20,12 @@
{
"path": "dist/packages/ec-preset-legacy/styles/ecl-ec-preset-legacy.css",
"webpack": false,
"limit": "24 KB"
"limit": "25 KB"
},
{
"path": "dist/packages/ec-preset-legacy/styles/ecl-ec-preset-legacy-print.css",
"webpack": false,
"limit": "10 KB"
"limit": "11 KB"
},
{
"path": "dist/packages/ec-preset-legacy-website/scripts/ecl-ec-preset-legacy-website.js",
Expand All @@ -34,12 +34,12 @@
{
"path": "dist/packages/ec-preset-legacy-website/styles/ecl-ec-preset-legacy-website.css",
"webpack": false,
"limit": "25 KB"
"limit": "26 KB"
},
{
"path": "dist/packages/ec-preset-legacy-website/styles/ecl-ec-preset-legacy-website-print.css",
"webpack": false,
"limit": "11 KB"
"limit": "12 KB"
},
{
"path": "dist/packages/ec-preset-website/scripts/ecl-ec-preset-website.js",
Expand All @@ -48,12 +48,12 @@
{
"path": "dist/packages/ec-preset-website/styles/ecl-ec-preset-website.css",
"webpack": false,
"limit": "23 KB"
"limit": "24 KB"
},
{
"path": "dist/packages/ec-preset-website/styles/ecl-ec-preset-website-print.css",
"webpack": false,
"limit": "11 KB"
"limit": "12 KB"
},
{
"path": "dist/packages/eu-preset-full/scripts/ecl-eu-preset-full.js",
Expand Down
@@ -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-hub-page/demo/data';

import MainPolicyHubPage from '../src/MainPolicyHubPage';

class MainPolicyHubExample 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 (
<MainPolicyHubPage
siteHeader={data.siteHeader}
footer={data.footer}
template={template}
/>
);
}
}

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

export default MainPolicyHubExample;
@@ -0,0 +1 @@
export default from './src/MainPolicyHubPage';
@@ -0,0 +1,45 @@
{
"private": true,
"name": "@ecl/ec-react-main-policy-hub-page",
"author": "European Commission",
"license": "EUPL-1.1",
"version": "2.13.0",
"description": "ECL EC React Main Policy Hub 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-date-block": "^2.13.0",
"@ecl/ec-react-component-description-list": "^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-follow": "^2.13.0",
"@ecl/ec-react-component-social-media-share": "^2.13.0",
"@ecl/ec-react-component-timeline2": "^2.13.0"
},
"devDependencies": {
"@ecl/ec-layout-grid": "^2.13.0",
"@ecl/ec-specs-main-policy-hub-page": "^2.13.0",
"@ecl/ec-utility-dimension": "^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"
}
}

0 comments on commit 8f37d83

Please sign in to comment.