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 1
1
import 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' ;
3
9
import { usePreference } from 'compass-preferences-model/provider' ;
4
10
5
11
type DeleteMenuButtonProps = {
6
12
isWritable : boolean ;
7
13
onClick : ( ) => void ;
8
14
} ;
9
15
16
+ const hiddenOnNarrowStyles = css ( {
17
+ [ `@container ${ WorkspaceContainer . toolbarContainerQueryName } (width < 900px)` ] :
18
+ {
19
+ display : 'none' ,
20
+ } ,
21
+ } ) ;
22
+
10
23
const DeleteMenuButton : React . FunctionComponent < DeleteMenuButtonProps > = ( {
11
24
isWritable,
12
25
onClick,
@@ -26,7 +39,7 @@ const DeleteMenuButton: React.FunctionComponent<DeleteMenuButtonProps> = ({
26
39
leftGlyph = { < Icon glyph = "Trash" > </ Icon > }
27
40
data-testid = "crud-bulk-delete"
28
41
>
29
- Delete
42
+ < span className = { hiddenOnNarrowStyles } > Delete</ span >
30
43
</ Button >
31
44
) ;
32
45
} ;
Original file line number Diff line number Diff line change 1
1
import 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' ;
3
9
import { usePreference } from 'compass-preferences-model/provider' ;
4
10
5
11
type UpdateMenuButtonProps = {
6
12
isWritable : boolean ;
7
13
onClick : ( ) => void ;
8
14
} ;
9
15
16
+ const hiddenOnNarrowStyles = css ( {
17
+ [ `@container ${ WorkspaceContainer . toolbarContainerQueryName } (width < 900px)` ] :
18
+ {
19
+ display : 'none' ,
20
+ } ,
21
+ } ) ;
22
+
10
23
const UpdateMenuButton : React . FunctionComponent < UpdateMenuButtonProps > = ( {
11
24
isWritable,
12
25
onClick,
@@ -26,7 +39,7 @@ const UpdateMenuButton: React.FunctionComponent<UpdateMenuButtonProps> = ({
26
39
leftGlyph = { < Icon glyph = "Edit" > </ Icon > }
27
40
data-testid = "crud-update"
28
41
>
29
- Update
42
+ < span className = { hiddenOnNarrowStyles } > Update</ span >
30
43
</ Button >
31
44
) ;
32
45
} ;
You can’t perform that action at this time.
0 commit comments