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

Header check for data improved & better fix for the text issue #2

Merged
merged 2 commits into from
Nov 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
12 changes: 9 additions & 3 deletions src/components/theme/Header/HeaderImage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
nileshgulia1 marked this conversation as resolved.
Show resolved Hide resolved
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 ? (
Expand Down