@eeacms/volto-eea-website-theme 0.6.15 → 0.6.18
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 +25 -0
- package/package.json +1 -1
- package/src/config.js +1 -1
- package/src/customizations/@eeacms/volto-eea-design-system/ui/Header/HeaderSearchPopUp.js +7 -1
- package/src/customizations/volto/components/theme/Breadcrumbs/Breadcrumbs.jsx +26 -2
- package/src/customizations/volto/components/theme/Header/Header.jsx +14 -3
- package/theme/theme.config +1 -0
package/CHANGELOG.md
CHANGED
@@ -4,8 +4,33 @@ 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.18](https://github.com/eea/volto-eea-website-theme/compare/0.6.17...0.6.18)
|
8
|
+
|
9
|
+
- change(megamenu): added icon on mega menu header section [`2ee9011`](https://github.com/eea/volto-eea-website-theme/commit/2ee901166a03b32db48379c5af109684c07a854c)
|
10
|
+
|
11
|
+
#### [0.6.17](https://github.com/eea/volto-eea-website-theme/compare/0.6.16...0.6.17)
|
12
|
+
|
13
|
+
> 3 August 2022
|
14
|
+
|
15
|
+
- Develop [`#52`](https://github.com/eea/volto-eea-website-theme/pull/52)
|
16
|
+
- Set focus on search input field in the popup on click [`#50`](https://github.com/eea/volto-eea-website-theme/pull/50)
|
17
|
+
|
18
|
+
#### [0.6.16](https://github.com/eea/volto-eea-website-theme/compare/0.6.15...0.6.16)
|
19
|
+
|
20
|
+
> 1 August 2022
|
21
|
+
|
22
|
+
- Release [`#49`](https://github.com/eea/volto-eea-website-theme/pull/49)
|
23
|
+
- Nonapi breadcrumbs [`#48`](https://github.com/eea/volto-eea-website-theme/pull/48)
|
24
|
+
- Make Breadcrumbs behave better with non-content routes [`9407840`](https://github.com/eea/volto-eea-website-theme/commit/94078403458a5a3ea725ce9126fffed9d463097d)
|
25
|
+
- change(megamenu): add border for active element of menu [`252efc4`](https://github.com/eea/volto-eea-website-theme/commit/252efc4485961c8d05e3703fee06179a0fdc8da3)
|
26
|
+
- change(footer): tweaked size of eionet logo to follow size of eea logo [`fcfa8ee`](https://github.com/eea/volto-eea-website-theme/commit/fcfa8ee00cffbc147eefa0f614b366c94f30945d)
|
27
|
+
- feature(theme): added context navigation component [`083b1c2`](https://github.com/eea/volto-eea-website-theme/commit/083b1c272623c720ebfeb4338e59c2cefcb29ecc)
|
28
|
+
|
7
29
|
#### [0.6.15](https://github.com/eea/volto-eea-website-theme/compare/0.6.14...0.6.15)
|
8
30
|
|
31
|
+
> 1 July 2022
|
32
|
+
|
33
|
+
- Release [`#47`](https://github.com/eea/volto-eea-website-theme/pull/47)
|
9
34
|
- Moved customized Toolbar to volto-eea-website-policy [`403b06d`](https://github.com/eea/volto-eea-website-theme/commit/403b06dd1225f4f15883d938d47facfe730a3699)
|
10
35
|
- change(logo): use a real svg logo for white eea logo [`e2703af`](https://github.com/eea/volto-eea-website-theme/commit/e2703af2bf3779ad3aa21fa673fa5652691a9f25)
|
11
36
|
|
package/package.json
CHANGED
package/src/config.js
CHANGED
@@ -3,7 +3,12 @@ import { Container, Input } from 'semantic-ui-react';
|
|
3
3
|
import { withRouter } from 'react-router-dom';
|
4
4
|
import { useClickOutside } from '@eeacms/volto-eea-design-system/helpers';
|
5
5
|
|
6
|
-
function HeaderSearchPopUp({
|
6
|
+
function HeaderSearchPopUp({
|
7
|
+
history,
|
8
|
+
onClose,
|
9
|
+
searchInputRef,
|
10
|
+
triggerRefs = [],
|
11
|
+
}) {
|
7
12
|
const nodeRef = React.useRef();
|
8
13
|
const [text, setText] = React.useState('');
|
9
14
|
|
@@ -30,6 +35,7 @@ function HeaderSearchPopUp({ history, onClose, triggerRefs = [] }) {
|
|
30
35
|
<Container>
|
31
36
|
<div className="wrapper">
|
32
37
|
<Input
|
38
|
+
ref={searchInputRef}
|
33
39
|
className="search"
|
34
40
|
onChange={onChangeText}
|
35
41
|
icon={{
|
@@ -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
|
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 (
|
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,18 @@ const EEAHeader = ({ pathname, token, items, history }) => {
|
|
192
194
|
{item.title}
|
193
195
|
</a>
|
194
196
|
)}
|
195
|
-
renderMenuItem={(item) => (
|
196
|
-
<UniversalLink
|
197
|
-
|
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?.iconPosition !== 'right' && props?.children}
|
207
|
+
<span>{item.title}</span>
|
208
|
+
{props?.iconPosition === 'right' && props?.children}
|
198
209
|
</UniversalLink>
|
199
210
|
)}
|
200
211
|
></Header.Main>
|