Skip to content

Commit

Permalink
fix: header sticky in controlpanel
Browse files Browse the repository at this point in the history
  • Loading branch information
giuliaghisini committed Nov 18, 2024
1 parent b148327 commit 499d436
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/customizations/volto/components/theme/Header/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

import React, { useEffect, useState } from 'react';
import { useLocation } from 'react-router-dom';
import PropTypes from 'prop-types';
import cx from 'classnames';
import { useSelector } from 'react-redux';
Expand All @@ -24,9 +25,12 @@ import {
import { Headers } from 'design-react-kit';

const Header = ({ pathname }) => {
const location = useLocation();
const [mini, setMini] = useState(false);
const isEditMode = useSelector(
(state) => Object.keys(state.form.global ?? {})?.length > 0,
(state) =>
Object.keys(state.form.global ?? {})?.length > 0 ||
location.pathname.indexOf('/controlpanel') === 0,
);

const handleScroll = () => {
Expand Down

0 comments on commit 499d436

Please sign in to comment.