Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix block movers in navigator on experimental navigation page displaying horizontally #23779

Merged
merged 2 commits into from
Jul 8, 2020
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,15 @@ import { useViewportMatch } from '@wordpress/compose';
*/
import BlockMover from '../block-mover';

function BlockMobileToolbar( { clientId, moverDirection } ) {
function BlockMobileToolbar( { clientId } ) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this file can actually be deleted. I couldn't see any usage other than the native mobile version of it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't deleting it break the native mobile app, then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's what I don't know. I don't think so as there's a separate index.native.js.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha, gotcha. Yeah you're right that it probably can be removed.

const isMobile = useViewportMatch( 'small', '<' );
if ( ! isMobile ) {
return null;
}

return (
<div className="block-editor-block-mobile-toolbar">
<BlockMover
clientIds={ [ clientId ] }
__experimentalOrientation={ moverDirection }
/>
<BlockMover clientIds={ [ clientId ] } />
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export default function BlockNavigationBlock( {
<TreeGridItem>
{ ( { ref, tabIndex, onFocus } ) => (
<BlockMoverUpButton
__experimentalOrientation="vertical"
orientation="vertical"
clientIds={ [ clientId ] }
ref={ ref }
tabIndex={ tabIndex }
Expand All @@ -131,7 +131,7 @@ export default function BlockNavigationBlock( {
<TreeGridItem>
{ ( { ref, tabIndex, onFocus } ) => (
<BlockMoverDownButton
__experimentalOrientation="vertical"
orientation="vertical"
clientIds={ [ clientId ] }
ref={ ref }
tabIndex={ tabIndex }
Expand Down