@eeacms/volto-eea-website-theme 0.6.15 → 0.6.16

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,19 @@ 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.16](https://github.com/eea/volto-eea-website-theme/compare/0.6.15...0.6.16)
8
+
9
+ - Nonapi breadcrumbs [`#48`](https://github.com/eea/volto-eea-website-theme/pull/48)
10
+ - Make Breadcrumbs behave better with non-content routes [`9407840`](https://github.com/eea/volto-eea-website-theme/commit/94078403458a5a3ea725ce9126fffed9d463097d)
11
+ - change(megamenu): add border for active element of menu [`252efc4`](https://github.com/eea/volto-eea-website-theme/commit/252efc4485961c8d05e3703fee06179a0fdc8da3)
12
+ - change(footer): tweaked size of eionet logo to follow size of eea logo [`fcfa8ee`](https://github.com/eea/volto-eea-website-theme/commit/fcfa8ee00cffbc147eefa0f614b366c94f30945d)
13
+ - feature(theme): added context navigation component [`083b1c2`](https://github.com/eea/volto-eea-website-theme/commit/083b1c272623c720ebfeb4338e59c2cefcb29ecc)
14
+
7
15
  #### [0.6.15](https://github.com/eea/volto-eea-website-theme/compare/0.6.14...0.6.15)
8
16
 
17
+ > 1 July 2022
18
+
19
+ - Release [`#47`](https://github.com/eea/volto-eea-website-theme/pull/47)
9
20
  - Moved customized Toolbar to volto-eea-website-policy [`403b06d`](https://github.com/eea/volto-eea-website-theme/commit/403b06dd1225f4f15883d938d47facfe730a3699)
10
21
  - change(logo): use a real svg logo for white eea logo [`e2703af`](https://github.com/eea/volto-eea-website-theme/commit/e2703af2bf3779ad3aa21fa673fa5652691a9f25)
11
22
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-website-theme",
3
- "version": "0.6.15",
3
+ "version": "0.6.16",
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",
package/src/config.js CHANGED
@@ -108,7 +108,7 @@ export const footerOpts = {
108
108
  columnSize: {
109
109
  mobile: 6,
110
110
  tablet: 12,
111
- computer: 7,
111
+ computer: 6,
112
112
  },
113
113
  },
114
114
  ],
@@ -6,14 +6,35 @@
6
6
  import React, { useEffect } from 'react';
7
7
  import { useDispatch, useSelector } from 'react-redux';
8
8
 
9
+ import { useLocation } from 'react-router';
9
10
  import { getBaseUrl, hasApiExpander } from '@plone/volto/helpers';
10
11
  import { getBreadcrumbs } from '@plone/volto/actions';
12
+ import config from '@plone/volto/registry';
13
+
11
14
  import EEABreadcrumbs from '@eeacms/volto-eea-design-system/ui/Breadcrumbs/Breadcrumbs';
12
15
 
16
+ const isContentRoute = (pathname) => {
17
+ const { settings } = config;
18
+ const normalized_nonContentRoutes = settings.nonContentRoutes.map((item) => {
19
+ if (item.test) {
20
+ return item;
21
+ } else {
22
+ return new RegExp(item + '$');
23
+ }
24
+ });
25
+
26
+ const isNonContentRoute =
27
+ normalized_nonContentRoutes.findIndex((item) => item.test(pathname)) > -1;
28
+
29
+ return !isNonContentRoute;
30
+ };
31
+
13
32
  const Breadcrumbs = (props) => {
14
33
  const dispatch = useDispatch();
15
34
  const { items = [], root = '/' } = useSelector((state) => state?.breadcrumbs);
16
- const { pathname } = props;
35
+ // const pathname = useSelector((state) => state.location.pathname);
36
+ const location = useLocation();
37
+ const { pathname } = location;
17
38
 
18
39
  const sections = items.map((item) => ({
19
40
  title: item.title,
@@ -22,7 +43,10 @@ const Breadcrumbs = (props) => {
22
43
  }));
23
44
 
24
45
  useEffect(() => {
25
- if (!hasApiExpander('breadcrumbs', getBaseUrl(pathname))) {
46
+ if (
47
+ !hasApiExpander('breadcrumbs', getBaseUrl(pathname)) &&
48
+ isContentRoute(pathname)
49
+ ) {
26
50
  dispatch(getBreadcrumbs(getBaseUrl(pathname)));
27
51
  }
28
52
  }, [dispatch, pathname]);
@@ -27,6 +27,8 @@ import config from '@plone/volto/registry';
27
27
  import { compose } from 'recompose';
28
28
  import { BodyClass } from '@plone/volto/helpers';
29
29
 
30
+ import cx from 'classnames';
31
+
30
32
  /**
31
33
  * EEA Specific Header component.
32
34
  */
@@ -192,9 +194,17 @@ const EEAHeader = ({ pathname, token, items, history }) => {
192
194
  {item.title}
193
195
  </a>
194
196
  )}
195
- renderMenuItem={(item) => (
196
- <UniversalLink href={item.url || '/'} title={item.title}>
197
- <span className={'item'}>{item.title}</span>
197
+ renderMenuItem={(item, options, props) => (
198
+ <UniversalLink
199
+ href={item.url || '/'}
200
+ title={item.title}
201
+ {...(options || {})}
202
+ className={cx(options?.className, {
203
+ active: item.url === router_pathname,
204
+ })}
205
+ >
206
+ {props?.children}
207
+ <span>{item.title}</span>
198
208
  </UniversalLink>
199
209
  )}
200
210
  ></Header.Main>
@@ -86,6 +86,7 @@
86
86
  @tag : 'eea';
87
87
  @tags : 'eea';
88
88
  @tagList : 'eea';
89
+ @contextNavigation : 'eea';
89
90
  @inpageNavigation : 'eea';
90
91
  @avatar : 'eea';
91
92
  @divider : 'eea';