@@ -15,6 +15,7 @@ import { __, sprintf, _n } from '@wordpress/i18n';
1515import { useMemo , useState , useRef , useContext } from '@wordpress/element' ;
1616import { useRegistry } from '@wordpress/data' ;
1717import { closeSmall } from '@wordpress/icons' ;
18+ import { useViewportMatch } from '@wordpress/compose' ;
1819
1920/**
2021 * Internal dependencies
@@ -165,6 +166,22 @@ function ActionTrigger< Item >( {
165166} : ActionTriggerProps < Item > ) {
166167 const label =
167168 typeof action . label === 'string' ? action . label : action . label ( items ) ;
169+ const isMobile = useViewportMatch ( 'medium' , '<' ) ;
170+
171+ if ( isMobile ) {
172+ return (
173+ < Button
174+ disabled = { isBusy }
175+ accessibleWhenDisabled
176+ label = { label }
177+ icon = { action . icon }
178+ size = "compact"
179+ onClick = { onClick }
180+ isBusy = { isBusy }
181+ />
182+ ) ;
183+ }
184+
168185 return (
169186 < Button
170187 disabled = { isBusy }
@@ -308,6 +325,7 @@ function FooterContent< Item >( {
308325 null
309326 ) ;
310327 const footerContentRef = useRef < JSX . Element | null > ( null ) ;
328+ const isMobile = useViewportMatch ( 'medium' , '<' ) ;
311329
312330 const bulkActions = useMemo (
313331 ( ) => actions . filter ( ( action ) => action . supportsBulk ) ,
@@ -334,13 +352,14 @@ function FooterContent< Item >( {
334352 actions . filter ( ( action ) => {
335353 return (
336354 action . supportsBulk &&
355+ ( ! isMobile || action . icon ) &&
337356 selectedItems . some (
338357 ( item ) =>
339358 ! action . isEligible || action . isEligible ( item )
340359 )
341360 ) ;
342361 } ) ,
343- [ actions , selectedItems ]
362+ [ actions , selectedItems , isMobile ]
344363 ) ;
345364 if ( ! actionInProgress ) {
346365 if ( footerContentRef . current ) {
0 commit comments