Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Consistent naming of isLargeViewport
isLargeViewport is used as both useViewportMatch( 'medium' ) and useViewportMatch( 'large' ). useViewportMatch( 'medium' ) to mean isLargeViewport seem
s to be the standardized way, so useViewportMatch( 'large' ) should equate to the size above it - isWideViewport.
  • Loading branch information
jeryj committed Nov 10, 2023
commit 4941d98e5672c6763593ce3dec047944ca1d479e
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default function BlockTools( {
__unstableContentRef,
...props
} ) {
const isLargeViewport = useViewportMatch( 'large' );
const isLargeViewport = useViewportMatch( 'medium' );
const {
clientId,
hasFixedToolbar,
Expand Down
2 changes: 1 addition & 1 deletion packages/customize-widgets/src/components/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function Header( {
setIsInserterOpened,
isFixedToolbarActive,
} ) {
const isLargeViewport = useViewportMatch( 'large' );
const isLargeViewport = useViewportMatch( 'medium' );
const blockToolbarRef = useRef();
const [ [ hasUndo, hasRedo ], setUndoRedo ] = useState( [
sidebar.hasUndo(),
Expand Down
7 changes: 4 additions & 3 deletions packages/edit-post/src/components/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ function Header( {
setEntitiesSavedStatesCallback,
setListViewToggleElement,
} ) {
const isLargeViewport = useViewportMatch( 'large' );
const isWideViewport = useViewportMatch( 'large' );
const isLargeViewport = useViewportMatch( 'medium' );
const blockToolbarRef = useRef();
const {
blockSelectionStart,
Expand Down Expand Up @@ -182,13 +183,13 @@ function Header( {
setEntitiesSavedStatesCallback
}
/>
{ ( isLargeViewport || ! showIconLabels ) && (
{ ( isWideViewport || ! showIconLabels ) && (
<>
<PinnedItems.Slot scope="core/edit-post" />
<MoreMenu showIconLabels={ showIconLabels } />
</>
) }
{ showIconLabels && ! isLargeViewport && (
{ showIconLabels && ! isWideViewport && (
<MoreMenu showIconLabels={ showIconLabels } />
) }
</motion.div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default function HeaderEditMode( { setListViewToggleElement } ) {
};
}, [] );

const isLargeViewport = useViewportMatch( 'large' );
const isLargeViewport = useViewportMatch( 'medium' );
const isTopToolbar = ! isZoomOutMode && hasFixedToolbar && isLargeViewport;
const blockToolbarRef = useRef();

Expand Down
7 changes: 3 additions & 4 deletions packages/edit-widgets/src/components/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ import { unlock } from '../../lock-unlock';
const { BlockContextualToolbar } = unlock( blockEditorPrivateApis );

function Header( { setListViewToggleElement } ) {
const isMediumViewport = useViewportMatch( 'medium' );
const isLargeViewport = useViewportMatch( 'large' );
const isLargeViewport = useViewportMatch( 'medium' );
const blockToolbarRef = useRef();
const { hasFixedToolbar } = useSelect(
( select ) => ( {
Expand All @@ -38,12 +37,12 @@ function Header( { setListViewToggleElement } ) {
<>
<div className="edit-widgets-header">
<div className="edit-widgets-header__navigable-toolbar-wrapper">
{ isMediumViewport && (
{ isLargeViewport && (
<h1 className="edit-widgets-header__title">
{ __( 'Widgets' ) }
</h1>
) }
{ ! isMediumViewport && (
{ ! isLargeViewport && (
<VisuallyHidden
as="h1"
className="edit-widgets-header__title"
Expand Down