@eeacms/volto-eea-website-theme 0.6.6 → 0.6.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,10 +4,40 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ #### [0.6.9](https://github.com/eea/volto-eea-website-theme/compare/0.6.8...0.6.9)
8
+
9
+ - Add custom styles: Content Box [`724257a`](https://github.com/eea/volto-eea-website-theme/commit/724257a840ff52a4be525540272d7a4839ffab34)
10
+
11
+ #### [0.6.8](https://github.com/eea/volto-eea-website-theme/compare/0.6.7...0.6.8)
12
+
13
+ > 13 June 2022
14
+
15
+ - change(theme): added homepage and homepage inverted pages [`#39`](https://github.com/eea/volto-eea-website-theme/pull/39)
16
+ - Fix HomepageView typo [`41582a3`](https://github.com/eea/volto-eea-website-theme/commit/41582a39f8e84cd3ef62d9ef302798627e8350f1)
17
+ - fix import to please jslint [`b4a6555`](https://github.com/eea/volto-eea-website-theme/commit/b4a655548600ef9b9c8ecdd156d0062d4b54d00e)
18
+ - change(header): added homepage and homepage_inverse views [`6df68d7`](https://github.com/eea/volto-eea-website-theme/commit/6df68d7a592d623af76c1036c38d2c480fc6ce88)
19
+ - Fifty shades of gray [`9deae59`](https://github.com/eea/volto-eea-website-theme/commit/9deae599dc0e1431727067b281c32a58c1ac544c)
20
+ - Minimal search integration for Header popup [`14870df`](https://github.com/eea/volto-eea-website-theme/commit/14870df1b0d82d1e04955bfa8cc07c7b853737c6)
21
+ - Customize eea-design-system HeaderSearchPopUp. Copied unchanged [`4c9306c`](https://github.com/eea/volto-eea-website-theme/commit/4c9306c6afe4c62cbc74f3510339c4a6dbbd210a)
22
+ - Customize available colors in volto-block-style [`5c5adb5`](https://github.com/eea/volto-eea-website-theme/commit/5c5adb541b3e7d84daf110e9eab7ec7950e0e989)
23
+ - change(theme): set draft bg to the content-area instead of the body area [`33be595`](https://github.com/eea/volto-eea-website-theme/commit/33be595a353afc570f8887c3bf55f6482c573fd8)
24
+ - change(header): add homepage class to plone site [`c6f912b`](https://github.com/eea/volto-eea-website-theme/commit/c6f912b59f288e7ddb4679f2a3b7011c6ce02c8c)
25
+
26
+ #### [0.6.7](https://github.com/eea/volto-eea-website-theme/compare/0.6.6...0.6.7)
27
+
28
+ > 9 June 2022
29
+
30
+ - change(footer): updated managed by grid sizes from footer.stories [`#38`](https://github.com/eea/volto-eea-website-theme/pull/38)
31
+ - change(footer): updated managed by grid sizes from footer.stories #37 [`63b86be`](https://github.com/eea/volto-eea-website-theme/commit/63b86becdf5a501b133e3b4ff05b1ab0e6281f12)
32
+ - change(footer): updated managed by grid sizes as se [`6be36fa`](https://github.com/eea/volto-eea-website-theme/commit/6be36fa6e8d8a2762fce65b71bb0e0c795a050a2)
33
+
7
34
  #### [0.6.6](https://github.com/eea/volto-eea-website-theme/compare/0.6.5...0.6.6)
8
35
 
9
- - condition config of accordion only if found to avoid error [`21b9cd7`](https://github.com/eea/volto-eea-website-theme/commit/21b9cd7006aed894e0eac5aa4a4b370233b334ab)
10
- - Add customization for volto-tabs-block [`71878f4`](https://github.com/eea/volto-eea-website-theme/commit/71878f49e9e34f9fbab66c6b805dd9ff6e353b29)
36
+ > 8 June 2022
37
+
38
+ - condition config of accordion only if found to avoid error [`#36`](https://github.com/eea/volto-eea-website-theme/pull/36)
39
+ - Add customization for volto-tabs-block [`#35`](https://github.com/eea/volto-eea-website-theme/pull/35)
40
+ - change(footer): update footer implementation [`#34`](https://github.com/eea/volto-eea-website-theme/pull/34)
11
41
  - change(footer): update footer implementation to use subfooter section #33 [`e4cb3c0`](https://github.com/eea/volto-eea-website-theme/commit/e4cb3c042414ba5811924b40c532738da978fdbd)
12
42
  - change(footer): update footer implementation to use latest changes to the subfooter component [`efa23fe`](https://github.com/eea/volto-eea-website-theme/commit/efa23fecee0786c3d9a254c8115b3f28a8be5302)
13
43
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-website-theme",
3
- "version": "0.6.6",
3
+ "version": "0.6.9",
4
4
  "description": "@eeacms/volto-eea-website-theme: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -1,3 +1,3 @@
1
- body.view-viewview:not(.wf-state-published) {
1
+ .view-viewview:not(.wf-state-published) .content-area {
2
2
  background-image: url('draft.png') !important;
3
3
  }
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Document view component.
3
+ * @module components/theme/View/HomePageInverseView
4
+ */
5
+
6
+ import React from 'react';
7
+ import PropTypes from 'prop-types';
8
+
9
+ import { DefaultView } from '@plone/volto/components/';
10
+
11
+ import { BodyClass } from '@plone/volto/helpers';
12
+
13
+ import { hasBlocksData } from '@plone/volto/helpers';
14
+
15
+ /**
16
+ * Component to display the default view.
17
+ * @function HomePageInverseView
18
+ * @param {Object} content Content object.
19
+ * @returns {string} Markup of the component.
20
+ */
21
+ const HomePageInverseView = ({ content }) => {
22
+ return hasBlocksData(content) ? (
23
+ <>
24
+ <BodyClass className="homepage homepage-inverse" />
25
+ <DefaultView content={content} />
26
+ </>
27
+ ) : null;
28
+ };
29
+
30
+ /**
31
+ * Property types.
32
+ * @property {Object} propTypes Property types.
33
+ * @static
34
+ */
35
+ HomePageInverseView.propTypes = {
36
+ /**
37
+ * Content of the object
38
+ */
39
+ content: PropTypes.shape({
40
+ /**
41
+ * Title of the object
42
+ */
43
+ title: PropTypes.string,
44
+ /**
45
+ * Description of the object
46
+ */
47
+ description: PropTypes.string,
48
+ /**
49
+ * Text of the object
50
+ */
51
+ text: PropTypes.shape({
52
+ /**
53
+ * Data of the text of the object
54
+ */
55
+ data: PropTypes.string,
56
+ }),
57
+ }).isRequired,
58
+ };
59
+
60
+ export default HomePageInverseView;
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Document view component.
3
+ * @module components/theme/View/HomePageView
4
+ */
5
+
6
+ import React from 'react';
7
+ import PropTypes from 'prop-types';
8
+
9
+ import { DefaultView } from '@plone/volto/components/';
10
+
11
+ import { BodyClass } from '@plone/volto/helpers';
12
+
13
+ import { hasBlocksData } from '@plone/volto/helpers';
14
+
15
+ /**
16
+ * Component to display the default view.
17
+ * @function HomePageView
18
+ * @param {Object} content Content object.
19
+ * @returns {string} Markup of the component.
20
+ */
21
+ const HomePageView = ({ content }) => {
22
+ return hasBlocksData(content) ? (
23
+ <>
24
+ <BodyClass className="homepage" />
25
+ <DefaultView content={content} />
26
+ </>
27
+ ) : null;
28
+ };
29
+
30
+ /**
31
+ * Property types.
32
+ * @property {Object} propTypes Property types.
33
+ * @static
34
+ */
35
+ HomePageView.propTypes = {
36
+ /**
37
+ * Content of the object
38
+ */
39
+ content: PropTypes.shape({
40
+ /**
41
+ * Title of the object
42
+ */
43
+ title: PropTypes.string,
44
+ /**
45
+ * Description of the object
46
+ */
47
+ description: PropTypes.string,
48
+ /**
49
+ * Text of the object
50
+ */
51
+ text: PropTypes.shape({
52
+ /**
53
+ * Data of the text of the object
54
+ */
55
+ data: PropTypes.string,
56
+ }),
57
+ }).isRequired,
58
+ };
59
+
60
+ export default HomePageView;
package/src/config.js CHANGED
@@ -95,7 +95,7 @@ export const footerOpts = {
95
95
  alt: 'EEA Logo',
96
96
  className: 'site logo',
97
97
  columnSize: {
98
- mobile: 12,
98
+ mobile: 6,
99
99
  tablet: 12,
100
100
  computer: 5,
101
101
  },
@@ -106,9 +106,9 @@ export const footerOpts = {
106
106
  alt: 'EIONET Logo',
107
107
  className: 'eionet logo',
108
108
  columnSize: {
109
- mobile: 12,
109
+ mobile: 6,
110
110
  tablet: 12,
111
- computer: 6,
111
+ computer: 7,
112
112
  },
113
113
  },
114
114
  ],
@@ -0,0 +1,38 @@
1
+ const updatedEEAColorcheme = [
2
+ // Primary & shades
3
+ '#007B6C',
4
+ '#005248',
5
+ '#007B6C',
6
+ '#00A390',
7
+ '#00CCB4',
8
+ '#00F5D8',
9
+ '#85FFF1',
10
+ '#C8FFF8',
11
+ // Secondary & shades
12
+ '#004B7F',
13
+ '#003052',
14
+ '#004B7F',
15
+ '#006BB8',
16
+ '#0083E0',
17
+ '#0A99FF',
18
+ '#47B3FF',
19
+ '#A0D7FF',
20
+ // Tertiary & shades
21
+ '#2E3E4C',
22
+ '#3D5265',
23
+ '#4C677F',
24
+ '#6989A5',
25
+ '#8EA6C2',
26
+ '#ACCAE5',
27
+ '#DAE8F4',
28
+ // Black & White shades
29
+ '#000000',
30
+ '#323232',
31
+ '#67696b',
32
+ '#BCBEC0',
33
+ '#E6E7E8',
34
+ '#F9F9F9',
35
+ '#FFFFFF',
36
+ ];
37
+
38
+ export default updatedEEAColorcheme;
@@ -0,0 +1,44 @@
1
+ import React from 'react';
2
+ import { Container, Input } from 'semantic-ui-react';
3
+ import { withRouter } from 'react-router-dom';
4
+ import { useClickOutside } from '@eeacms/volto-eea-design-system/helpers';
5
+
6
+ function HeaderSearchPopUp({ history, onClose, triggerRefs = [] }) {
7
+ const nodeRef = React.useRef();
8
+ const [text, setText] = React.useState('');
9
+
10
+ useClickOutside({ targetRefs: [nodeRef, ...triggerRefs], callback: onClose });
11
+
12
+ const onChangeText = (event, { value }) => {
13
+ setText(value);
14
+ event.preventDefault();
15
+ };
16
+
17
+ const onSubmit = (event) => {
18
+ history.push(`/en/advanced-search?q=${text}`);
19
+ onClose();
20
+ event.preventDefault();
21
+ };
22
+
23
+ return (
24
+ <form id="search-box" ref={nodeRef} method="get" onSubmit={onSubmit}>
25
+ <Container>
26
+ <div className="wrapper">
27
+ <Input
28
+ className="search"
29
+ onChange={onChangeText}
30
+ icon={{
31
+ className: 'ri-search-line',
32
+ link: true,
33
+ onClick: onSubmit,
34
+ }}
35
+ placeholder="Search..."
36
+ fluid
37
+ />
38
+ </div>
39
+ </Container>
40
+ </form>
41
+ );
42
+ }
43
+
44
+ export default withRouter(HeaderSearchPopUp);
@@ -18,6 +18,7 @@ import { getNavigation } from '@plone/volto/actions';
18
18
  import { Header, Logo } from '@eeacms/volto-eea-design-system/ui';
19
19
  import { usePrevious } from '@eeacms/volto-eea-design-system/helpers';
20
20
  import { find } from 'lodash';
21
+ import WhiteLogoImage from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/logo/eea.svg';
21
22
  import LogoImage from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/images/Header/eea-logo.svg';
22
23
  import globeIcon from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/images/Header/global-line.svg';
23
24
  import eeaFlag from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/images/Header/eea.png';
@@ -33,6 +34,9 @@ const EEAHeader = ({ pathname, token, items, history }) => {
33
34
  const translations = useSelector(
34
35
  (state) => state.content.data?.['@components']?.translations?.items,
35
36
  );
37
+ const isHomePageInverse = useSelector((state) => {
38
+ return state.content?.data?.layout === 'homepage_inverse_view';
39
+ });
36
40
 
37
41
  const { eea } = config.settings;
38
42
  const width = useSelector((state) => state.screen?.width);
@@ -154,9 +158,11 @@ const EEAHeader = ({ pathname, token, items, history }) => {
154
158
  </Header.TopHeader>
155
159
  <Header.Main
156
160
  pathname={pathname}
161
+ inverted={isHomePageInverse ? true : false}
162
+ transparency={isHomePageInverse ? true : false}
157
163
  logo={
158
164
  <Logo
159
- src={LogoImage}
165
+ src={isHomePageInverse ? WhiteLogoImage : LogoImage}
160
166
  title={eea.websiteTitle}
161
167
  alt={eea.organisationName}
162
168
  url={eea.logoTargetUrl}
package/src/index.js CHANGED
@@ -4,13 +4,22 @@ import installCustomTitle from '@eeacms/volto-eea-website-theme/components/manag
4
4
  import CustomCSS from '@eeacms/volto-eea-website-theme/components/theme/CustomCSS/CustomCSS';
5
5
  import DraftBackground from '@eeacms/volto-eea-website-theme/components/theme/DraftBackground/DraftBackground';
6
6
  import { TokenWidget } from '@eeacms/volto-eea-website-theme/components/theme/Widgets/TokenWidget';
7
+ import HomePageView from '@eeacms/volto-eea-website-theme/components/theme/Homepage/HomePageView';
8
+ import HomePageInverseView from '@eeacms/volto-eea-website-theme/components/theme/Homepage/HomePageInverseView';
7
9
 
8
10
  const applyConfig = (config) => {
11
+ // EEA specific settings
9
12
  config.settings.eea = {
10
13
  ...eea,
11
14
  ...(config.settings.eea || {}),
12
15
  };
13
16
 
17
+ // Homepage
18
+ config.views.layoutViews = {
19
+ homepage_view: HomePageView,
20
+ homepage_inverse_view: HomePageInverseView,
21
+ };
22
+
14
23
  // Apply accordion block customization
15
24
  if (config.blocks.blocksConfig.accordion) {
16
25
  config.blocks.blocksConfig.accordion.semanticIcon = 'ri-arrow-down-s-line';
@@ -45,8 +54,8 @@ const applyConfig = (config) => {
45
54
  },
46
55
  ];
47
56
 
57
+ // Custom CSS voltoCustom.css and Draft Background
48
58
  const appExtras = config.settings.appExtras || [];
49
-
50
59
  config.settings.appExtras = [
51
60
  ...appExtras,
52
61
  {
@@ -59,6 +68,64 @@ const applyConfig = (config) => {
59
68
  },
60
69
  ];
61
70
 
71
+ // Custom block styles
72
+ config.settings.pluggableStyles = [
73
+ ...(config.settings.pluggableStyles || []),
74
+ {
75
+ id: 'content-box-gray',
76
+ title: 'Content Box',
77
+ viewComponent: (props) => {
78
+ return (
79
+ <div className="content-box">
80
+ <div className="content-box-inner ui container">
81
+ {props.children}
82
+ </div>
83
+ </div>
84
+ );
85
+ },
86
+ },
87
+ {
88
+ id: 'content-box-primary',
89
+ title: 'Content Box (primary)',
90
+ viewComponent: (props) => {
91
+ return (
92
+ <div className="content-box primary">
93
+ <div className="content-box-inner ui container">
94
+ {props.children}
95
+ </div>
96
+ </div>
97
+ );
98
+ },
99
+ },
100
+ {
101
+ id: 'content-box-secondary',
102
+ title: 'Content Box (secondary)',
103
+ viewComponent: (props) => {
104
+ return (
105
+ <div className="content-box secondary">
106
+ <div className="content-box-inner ui container">
107
+ {props.children}
108
+ </div>
109
+ </div>
110
+ );
111
+ },
112
+ },
113
+ {
114
+ id: 'content-box-tertiary',
115
+ title: 'Content Box (tertiary)',
116
+ viewComponent: (props) => {
117
+ return (
118
+ <div className="content-box tertiary">
119
+ <div className="content-box-inner ui container">
120
+ {props.children}
121
+ </div>
122
+ </div>
123
+ );
124
+ },
125
+ },
126
+ ];
127
+
128
+ // Custom blocks
62
129
  return [installCustomTitle].reduce((acc, apply) => apply(acc), config);
63
130
  };
64
131