Skip to content

Commit

Permalink
Merge pull request #298 from teamdigitale/develop
Browse files Browse the repository at this point in the history
Road to v1.6.0
  • Loading branch information
sebbalex authored Feb 10, 2022
2 parents bf2f2ac + 8e8c8c9 commit 51697e0
Show file tree
Hide file tree
Showing 3 changed files with 11,329 additions and 11,644 deletions.
16 changes: 9 additions & 7 deletions src/layouts/ComeFunzionaPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ export const ComeFunzionaPage = () => {
useEffect(() => {
if (howId) {
const element = document.querySelector('#' + howId);
const elDistanceToTop = window.pageYOffset + element.getBoundingClientRect().top;
window.scrollTo(0, elDistanceToTop);
element.setAttribute('tabindex', '-1');
element.focus();
return () => {
dispatch({ type: 'SET:HOW_SECTION_ID' });
};
if (element) {
const elDistanceToTop = window.pageYOffset + element.getBoundingClientRect().top;
window.scrollTo(0, elDistanceToTop);
element.setAttribute('tabindex', '-1');
element.focus();
return () => {
dispatch({ type: 'SET:HOW_SECTION_ID' });
};
}
}
}, [howId, dispatch]);

Expand Down
12 changes: 11 additions & 1 deletion src/pages/misure.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,20 @@ const Page = ({ location }) => {
const [, dispatch] = useContext(GlobalStateContext);

useEffect(() => {
const currentHash = location.hash?.split('#')[1];
if (currentHash) {
const filter = {
label: '',
value: '',
};
filter.label = currentHash.charAt(0).toUpperCase() + currentHash.slice(1);
filter.value = currentHash;
setFilter(filter);
}
if (location.state !== null) {
setFilter(location.state.filter);
}
}, [location.state]);
}, [location.state, location.hash]);

useEffect(() => {
dispatch({ type: 'SET:ACTIVE_HEADER', payload: { activeItem: 'misure' } });
Expand Down
Loading

0 comments on commit 51697e0

Please sign in to comment.