@eeacms/volto-eea-website-theme 0.6.7 → 0.6.8

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,8 +4,23 @@ 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.8](https://github.com/eea/volto-eea-website-theme/compare/0.6.7...0.6.8)
8
+
9
+ - Fix HomepageView typo [`41582a3`](https://github.com/eea/volto-eea-website-theme/commit/41582a39f8e84cd3ef62d9ef302798627e8350f1)
10
+ - fix import to please jslint [`b4a6555`](https://github.com/eea/volto-eea-website-theme/commit/b4a655548600ef9b9c8ecdd156d0062d4b54d00e)
11
+ - change(header): added homepage and homepage_inverse views [`6df68d7`](https://github.com/eea/volto-eea-website-theme/commit/6df68d7a592d623af76c1036c38d2c480fc6ce88)
12
+ - Fifty shades of gray [`9deae59`](https://github.com/eea/volto-eea-website-theme/commit/9deae599dc0e1431727067b281c32a58c1ac544c)
13
+ - Minimal search integration for Header popup [`14870df`](https://github.com/eea/volto-eea-website-theme/commit/14870df1b0d82d1e04955bfa8cc07c7b853737c6)
14
+ - Customize eea-design-system HeaderSearchPopUp. Copied unchanged [`4c9306c`](https://github.com/eea/volto-eea-website-theme/commit/4c9306c6afe4c62cbc74f3510339c4a6dbbd210a)
15
+ - Customize available colors in volto-block-style [`5c5adb5`](https://github.com/eea/volto-eea-website-theme/commit/5c5adb541b3e7d84daf110e9eab7ec7950e0e989)
16
+ - 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)
17
+ - change(header): add homepage class to plone site [`c6f912b`](https://github.com/eea/volto-eea-website-theme/commit/c6f912b59f288e7ddb4679f2a3b7011c6ce02c8c)
18
+
7
19
  #### [0.6.7](https://github.com/eea/volto-eea-website-theme/compare/0.6.6...0.6.7)
8
20
 
21
+ > 9 June 2022
22
+
23
+ - change(footer): updated managed by grid sizes from footer.stories [`#38`](https://github.com/eea/volto-eea-website-theme/pull/38)
9
24
  - change(footer): updated managed by grid sizes from footer.stories #37 [`63b86be`](https://github.com/eea/volto-eea-website-theme/commit/63b86becdf5a501b133e3b4ff05b1ab0e6281f12)
10
25
  - change(footer): updated managed by grid sizes as se [`6be36fa`](https://github.com/eea/volto-eea-website-theme/commit/6be36fa6e8d8a2762fce65b71bb0e0c795a050a2)
11
26
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-website-theme",
3
- "version": "0.6.7",
3
+ "version": "0.6.8",
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;
@@ -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,12 +4,18 @@ 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) => {
9
11
  config.settings.eea = {
10
12
  ...eea,
11
13
  ...(config.settings.eea || {}),
12
14
  };
15
+ config.views.layoutViews = {
16
+ homepage_view: HomePageView,
17
+ homepage_inverse_view: HomePageInverseView,
18
+ };
13
19
 
14
20
  // Apply accordion block customization
15
21
  if (config.blocks.blocksConfig.accordion) {