-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(main-policy-resources): add content type - INNO-1879 (#1375)
* add content type * update * small fixes
- Loading branch information
Showing
12 changed files
with
600 additions
and
0 deletions.
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
...stems/ec/implementations/react/templates/pages/main-policy-resources/examples/Default.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
1 change: 1 addition & 0 deletions
1
src/systems/ec/implementations/react/templates/pages/main-policy-resources/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default from './src/MainPolicyResourcesPage'; |
41 changes: 41 additions & 0 deletions
41
src/systems/ec/implementations/react/templates/pages/main-policy-resources/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
Oops, something went wrong.