diff --git a/CHANGELOG.md b/CHANGELOG.md index 51b66fc..7807430 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,15 @@ 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.2](https://github.com/eea/volto-forests-theme/compare/0.1.1...0.1.2) + +- Header check for data improved & better fix for the text issue [`310ac26`](https://github.com/eea/volto-forests-theme/commit/310ac26a03470c2cdb66377d643838488ec9bc09) + #### [0.1.1](https://github.com/eea/volto-forests-theme/compare/0.1.0...0.1.1) +> 3 November 2021 + +- Forest theme components [`#1`](https://github.com/eea/volto-forests-theme/pull/1) - skip cypress [`876c96d`](https://github.com/eea/volto-forests-theme/commit/876c96d0b5227bebe4c1f6d160b1bc7bc6d64e97) - fix tests [`cc1563c`](https://github.com/eea/volto-forests-theme/commit/cc1563c1e38fe567d983e12cae33780a1554da2b) - WIP [`15696de`](https://github.com/eea/volto-forests-theme/commit/15696de3e5062ade0ddf877a8e1dda0a44b0c33a) diff --git a/package.json b/package.json index e1ae44c..160b405 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@eeacms/volto-forests-theme", - "version": "0.1.1", + "version": "0.1.2", "description": "@eeacms/volto-forests-theme: Volto add-on", "main": "src/index.js", "author": "European Environment Agency: IDM2 A-Team", diff --git a/src/components/theme/Header/HeaderImage.jsx b/src/components/theme/Header/HeaderImage.jsx index 1eb5b77..ed3c285 100644 --- a/src/components/theme/Header/HeaderImage.jsx +++ b/src/components/theme/Header/HeaderImage.jsx @@ -10,11 +10,17 @@ function HeaderImage(props) { const headerDimension = isBig ? 600 : 280; const [contentCount, setContentCount] = React.useState(0); - const imageContent = document.getElementsByClassName('header-image-content'); - const ccount = imageContent[0] ? imageContent[0].childElementCount : 0; + const imageContent = + typeof window !== 'undefined' && window.document + ? window.document.getElementsByClassName('header-image-content') + : ''; + const ccount = + imageContent && imageContent[0] ? imageContent[0].childElementCount : 0; React.useEffect(() => { - setContentCount(ccount); + if (typeof window !== 'undefined') { + setContentCount(ccount); + } }, [ccount]); return props.url ? (