File tree Expand file tree Collapse file tree 2 files changed +30
-4
lines changed
packages/compass-crud/src/components Expand file tree Collapse file tree 2 files changed +30
-4
lines changed Original file line number Diff line number Diff line change 11import React from 'react' ;
2- import { Icon , Button , Tooltip } from '@mongodb-js/compass-components' ;
2+ import {
3+ Icon ,
4+ Button ,
5+ Tooltip ,
6+ WorkspaceContainer ,
7+ css ,
8+ } from '@mongodb-js/compass-components' ;
39import { usePreference } from 'compass-preferences-model/provider' ;
410
511type DeleteMenuButtonProps = {
612 isWritable : boolean ;
713 onClick : ( ) => void ;
814} ;
915
16+ const hiddenOnNarrowStyles = css ( {
17+ [ `@container ${ WorkspaceContainer . toolbarContainerQueryName } (width < 900px)` ] :
18+ {
19+ display : 'none' ,
20+ } ,
21+ } ) ;
22+
1023const DeleteMenuButton : React . FunctionComponent < DeleteMenuButtonProps > = ( {
1124 isWritable,
1225 onClick,
@@ -26,7 +39,7 @@ const DeleteMenuButton: React.FunctionComponent<DeleteMenuButtonProps> = ({
2639 leftGlyph = { < Icon glyph = "Trash" > </ Icon > }
2740 data-testid = "crud-bulk-delete"
2841 >
29- Delete
42+ < span className = { hiddenOnNarrowStyles } > Delete</ span >
3043 </ Button >
3144 ) ;
3245} ;
Original file line number Diff line number Diff line change 11import React from 'react' ;
2- import { Icon , Button , Tooltip } from '@mongodb-js/compass-components' ;
2+ import {
3+ Icon ,
4+ Button ,
5+ Tooltip ,
6+ css ,
7+ WorkspaceContainer ,
8+ } from '@mongodb-js/compass-components' ;
39import { usePreference } from 'compass-preferences-model/provider' ;
410
511type UpdateMenuButtonProps = {
612 isWritable : boolean ;
713 onClick : ( ) => void ;
814} ;
915
16+ const hiddenOnNarrowStyles = css ( {
17+ [ `@container ${ WorkspaceContainer . toolbarContainerQueryName } (width < 900px)` ] :
18+ {
19+ display : 'none' ,
20+ } ,
21+ } ) ;
22+
1023const UpdateMenuButton : React . FunctionComponent < UpdateMenuButtonProps > = ( {
1124 isWritable,
1225 onClick,
@@ -26,7 +39,7 @@ const UpdateMenuButton: React.FunctionComponent<UpdateMenuButtonProps> = ({
2639 leftGlyph = { < Icon glyph = "Edit" > </ Icon > }
2740 data-testid = "crud-update"
2841 >
29- Update
42+ < span className = { hiddenOnNarrowStyles } > Update</ span >
3043 </ Button >
3144 ) ;
3245} ;
You can’t perform that action at this time.
0 commit comments