Skip to content

Commit 8717a91

Browse files
jorgefilipecostaoandregaljameskoster
authored andcommitted
Update: Hide primary action buttons on mobile (#72597)
Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org> Co-authored-by: oandregal <oandregal@git.wordpress.org> Co-authored-by: jameskoster <jameskoster@git.wordpress.org>
1 parent 247e5cf commit 8717a91

File tree

1 file changed

+7
-0
lines changed
  • packages/dataviews/src/components/dataviews-item-actions

1 file changed

+7
-0
lines changed

packages/dataviews/src/components/dataviews-item-actions/index.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { __ } from '@wordpress/i18n';
1616
import { useMemo, useState } from '@wordpress/element';
1717
import { moreVertical } from '@wordpress/icons';
1818
import { useRegistry } from '@wordpress/data';
19+
import { useViewportMatch } from '@wordpress/compose';
1920

2021
/**
2122
* Internal dependencies
@@ -259,6 +260,12 @@ function PrimaryActions< Item >( {
259260
registry,
260261
}: PrimaryActionsProps< Item > ) {
261262
const [ activeModalAction, setActiveModalAction ] = useState( null as any );
263+
const isMobileViewport = useViewportMatch( 'medium', '<' );
264+
265+
if ( isMobileViewport ) {
266+
return null;
267+
}
268+
262269
if ( ! Array.isArray( actions ) || actions.length === 0 ) {
263270
return null;
264271
}

0 commit comments

Comments
 (0)