Skip to content

Commit

Permalink
Rename hasTopToolbar to showTopToolbar for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
jeryj committed Feb 14, 2024
1 parent d01277f commit 802b594
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/edit-post/src/components/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function Header( { setEntitiesSavedStatesCallback, initialPost } ) {
}, [] );

const { showFixedToolbar } = useShowBlockTools();
const hasTopToolbar = isLargeViewport && showFixedToolbar;
const showTopToolbar = isLargeViewport && showFixedToolbar;

const [ isBlockToolsCollapsed, setIsBlockToolsCollapsed ] =
useState( true );
Expand Down Expand Up @@ -118,7 +118,7 @@ function Header( { setEntitiesSavedStatesCallback, initialPost } ) {
className="edit-post-header__toolbar"
>
<DocumentTools disableBlockTools={ isTextEditor } />
{ hasTopToolbar && (
{ showTopToolbar && (
<>
<div
className={ classnames(
Expand Down Expand Up @@ -155,7 +155,7 @@ function Header( { setEntitiesSavedStatesCallback, initialPost } ) {
'is-collapsed':
hasHistory &&
! isBlockToolsCollapsed &&
hasTopToolbar,
showTopToolbar,
} ) }
>
{ hasHistory && <DocumentBar /> }
Expand Down
6 changes: 3 additions & 3 deletions packages/edit-site/src/components/header-edit-mode/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export default function HeaderEditMode() {

const isLargeViewport = useViewportMatch( 'medium' );
const { showFixedToolbar } = useShowBlockTools();
const hasTopToolbar = isLargeViewport && showFixedToolbar;
const showTopToolbar = isLargeViewport && showFixedToolbar;
const blockToolbarRef = useRef();
const disableMotion = useReducedMotion();

Expand Down Expand Up @@ -125,7 +125,7 @@ export default function HeaderEditMode() {
blockEditorMode={ blockEditorMode }
isDistractionFree={ isDistractionFree }
/>
{ hasTopToolbar && (
{ showTopToolbar && (
<>
<div
className={ classnames(
Expand Down Expand Up @@ -166,7 +166,7 @@ export default function HeaderEditMode() {
'edit-site-header-edit-mode__center',
{
'is-collapsed':
! isBlockToolsCollapsed && hasTopToolbar,
! isBlockToolsCollapsed && showTopToolbar,
}
) }
>
Expand Down

0 comments on commit 802b594

Please sign in to comment.