Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
Merge branch 'develop' of https://github.com/eea/volto-forests-theme
Browse files Browse the repository at this point in the history
…into redesign
  • Loading branch information
danielamormocea committed Nov 10, 2021
2 parents 6d90ee1 + 5b2349b commit 70e16c8
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 152 deletions.
39 changes: 39 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,47 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [0.1.9](https://github.com/eea/volto-forests-theme/compare/0.1.8...0.1.9)

- update volto-slate [`7248c0f`](https://github.com/eea/volto-forests-theme/commit/7248c0f0db2916f3a98d2f360e0da462545c49a9)
- remove api_path [`99418ac`](https://github.com/eea/volto-forests-theme/commit/99418ac02dfb0adb6af39c5e4a1e64a928070748)
- api_path [`1542048`](https://github.com/eea/volto-forests-theme/commit/1542048c90ee77e9ffc92a87f64856adad981af0)

#### [0.1.8](https://github.com/eea/volto-forests-theme/compare/0.1.7...0.1.8)

> 10 November 2021
- remove duplicate helpers [`#11`](https://github.com/eea/volto-forests-theme/pull/11)

#### [0.1.7](https://github.com/eea/volto-forests-theme/compare/0.1.6...0.1.7)

> 10 November 2021
- LeadNav update [`#9`](https://github.com/eea/volto-forests-theme/pull/9)

#### [0.1.6](https://github.com/eea/volto-forests-theme/compare/0.1.5...0.1.6)

> 9 November 2021
- Develop: hotfix for homepage view wide [`#8`](https://github.com/eea/volto-forests-theme/pull/8)
- use wideview on homepage [`63129c8`](https://github.com/eea/volto-forests-theme/commit/63129c8f2d614507064fbd381fa5922f851769e9)
- update [`70f5181`](https://github.com/eea/volto-forests-theme/commit/70f5181f92b3397788ff0fbf839b71b3ed70e2a9)

#### [0.1.5](https://github.com/eea/volto-forests-theme/compare/0.1.4...0.1.5)

> 8 November 2021
- Develop [`#7`](https://github.com/eea/volto-forests-theme/pull/7)
- update to volto 14 [`32c2318`](https://github.com/eea/volto-forests-theme/commit/32c231806a553bc06e783d8a8cb8e3576e57babe)
- fix query params [`7764b3a`](https://github.com/eea/volto-forests-theme/commit/7764b3a46e3b5fafca833f6ec838ac02dc1bee81)

#### [0.1.4](https://github.com/eea/volto-forests-theme/compare/0.1.3...0.1.4)

> 5 November 2021
- Updates on HeaderNavigation & Lead Image [`#5`](https://github.com/eea/volto-forests-theme/pull/5)
- lint fix [`25997f2`](https://github.com/eea/volto-forests-theme/commit/25997f2b27dd12b0b946021aed58add10325fc7b)
- Use screen width from store rather than hook [`b15911d`](https://github.com/eea/volto-forests-theme/commit/b15911d6e188f5e436ddd8828743137361f4f17b)
- Hover typo [`90b38c4`](https://github.com/eea/volto-forests-theme/commit/90b38c4b4552849581b193ebafa9e4664c17dded)
- window dimension hook cleanup [`6f94af1`](https://github.com/eea/volto-forests-theme/commit/6f94af12cf46f19e06d19a255497a465efb34180)
- window Dimension hook & mobile improvements to HeaderNavigation [`7b2f299`](https://github.com/eea/volto-forests-theme/commit/7b2f299806ed17a54f4f1c7568e9f1028e82c012)
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eeacms/volto-forests-theme",
"version": "0.1.4",
"version": "0.1.9",
"description": "@eeacms/volto-forests-theme: Volto add-on",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand Down Expand Up @@ -32,11 +32,11 @@
"raven-js": "3.27.2",
"recharts": "2.1.6",
"react-highlight-words": "^0.16.0",
"react-image-gallery": "1.0.8",
"react-image-gallery": "1.2.7",
"react-lazy-load-image-component": "^1.5.0",
"react-stickynode": "^2.1.1",
"react-toastify": "^5.3.2",
"volto-slate": "2.9.1",
"volto-slate": "4.2.1",
"webpack-bundle-analyzer": "^3.6.0"
},
"devDependencies": {
Expand Down
6 changes: 1 addition & 5 deletions src/components/manage/Blocks/NavigationBlock/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ import { Menu } from 'semantic-ui-react';
/* HELPERS */
import cx from 'classnames';
import { isActive, getNavigationByParent, getBasePath } from './helpers';
import {
deleteQueryParam,
setQueryParam,
} from '@eeacms/volto-datablocks/actions';
import { useEffect } from 'react';
import './styles.css';
import cookie from 'react-cookie';
Expand Down Expand Up @@ -249,6 +245,6 @@ export default compose(
)
: {},
}),
{ deleteQueryParam, setQueryParam },
{},
),
)(View);
16 changes: 8 additions & 8 deletions src/components/theme/Header/HeaderNavigation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import React from 'react';
import { useHistory } from 'react-router-dom';
import { Link } from 'react-router-dom';
import useWindowSize from '../../../helpers/useWindowSize';
import downIcon from '@plone/volto/icons/down-key.svg';
import closeIcon from '@plone/volto/icons/clear.svg';
import { Icon } from '@plone/volto/components';
import { connect } from 'react-redux';

const MobileNav = ({ items, activeItem }) => {
const [expanded, setExpanded] = React.useState(false);
Expand Down Expand Up @@ -61,28 +61,26 @@ const MobileNav = ({ items, activeItem }) => {
);
};

const HeaderNavigation = ({ items }) => {
const HeaderNavigation = ({ items, pageWidth }) => {
const [activeItem, setActiveItem] = React.useState('');
const [isMobile, setIsMobile] = React.useState(false);
const history = useHistory();
const size = useWindowSize();

React.useEffect(() => {
const { width } = size;
const activeRouteDetected = items.filter(
(item) => item.url === history.location.pathname,
);
if (activeRouteDetected && activeRouteDetected.length > 0) {
setActiveItem(activeRouteDetected[0]);
}
if (width && width <= 768) {
if (pageWidth && pageWidth <= 768) {
setIsMobile(true);
}
if (width && width > 768) {
if (pageWidth && pageWidth > 768) {
setIsMobile(false);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [items, size]);
}, [items, pageWidth]);

return (
<React.Fragment>
Expand All @@ -108,4 +106,6 @@ const HeaderNavigation = ({ items }) => {
);
};

export default HeaderNavigation;
export default connect((state) => ({
pageWidth: state.screen.page.width,
}))(HeaderNavigation);
104 changes: 0 additions & 104 deletions src/customizations/helpers/index.js

This file was deleted.

16 changes: 12 additions & 4 deletions src/customizations/volto/components/theme/View/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,17 @@ class View extends Component {
* @method getViewByLayout
* @returns {string} Markup for component.
*/
getViewByLayout = () =>
config.views.layoutViews[
this.props.content[getLayoutFieldname(this.props.content)]
] || null;
getViewByLayout = () => {
if (this.props.pathname === '/') {
return config.views.layoutViews['document_view_wide'];
}

return (
config.views.layoutViews[
this.props.content[getLayoutFieldname(this.props.content)]
] || null
);
};

/**
* Cleans the component displayName (specially for connected components)
Expand Down Expand Up @@ -359,6 +366,7 @@ export default compose(
injectIntl,
connect(
(state, props) => ({
state,
actions: state.actions.actions,
token: state.userSession.token,
content: state.content.data,
Expand Down
28 changes: 0 additions & 28 deletions src/helpers/useWindowSize.jsx

This file was deleted.

6 changes: 6 additions & 0 deletions theme/site/globals/site.overrides
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,14 @@ body.has-toolbar {
font-size: 16px;
font-weight: bold;
text-decoration: none;

@media (max-width: @computerBreakpoint) {
padding: 8px 10px;
font-size: 14px;
}
}


.lead-navigation-item:hover {
background: white;

Expand Down

0 comments on commit 70e16c8

Please sign in to comment.