File tree 7 files changed +23
-47
lines changed
components/TableWithControlsLayout
7 files changed +23
-47
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ const b = cn('ydb-table-with-controls-layout');
8
8
interface TableWithControlsLayoutItemProps {
9
9
children : React . ReactNode ;
10
10
className ?: string ;
11
- wrapperClassName ?: string ;
12
11
}
13
12
14
13
interface TableProps extends TableWithControlsLayoutItemProps {
@@ -25,10 +24,9 @@ export const TableWithControlsLayout = ({
25
24
TableWithControlsLayout . Controls = function TableControls ( {
26
25
children,
27
26
className,
28
- wrapperClassName,
29
27
} : TableWithControlsLayoutItemProps ) {
30
28
return (
31
- < div className = { b ( 'controls-wrapper' , wrapperClassName ) } >
29
+ < div className = { b ( 'controls-wrapper' ) } >
32
30
< div className = { b ( 'controls' , className ) } > { children } </ div >
33
31
</ div >
34
32
) ;
Original file line number Diff line number Diff line change 1
1
@use ' ../../styles/mixins.scss' ;
2
2
3
3
.ydb-cluster {
4
+ --cluster-side-padding : var (--g-spacing-5 );
4
5
position : relative ;
5
6
6
- display : flex ;
7
7
overflow : auto ;
8
- flex-grow : 1 ;
9
- flex-direction : column ;
10
8
9
+ width : 100% ;
11
10
height : 100% ;
12
- padding : 0 20 px ;
11
+ padding : 0 var ( --cluster-side-padding ) ;
13
12
14
13
& __header {
15
14
position : sticky ;
33
32
z-index : 3 ;
34
33
35
34
margin-top : 20px ;
36
- margin-right : -40 px ;
37
- padding-right : 40 px ;
38
- padding-left : 20 px ;
35
+ margin-right : calc ( var ( --cluster-side-padding ) * -2 ) ;
36
+ padding-right : calc ( var ( --cluster-side-padding ) * 2 ) ;
37
+ padding-left : var ( --cluster-side-padding ) ;
39
38
40
- transform : translateX (-20 px );
39
+ transform : translateX (calc ( var ( --cluster-side-padding ) * -1 ) );
41
40
@include mixins .sticky-top ();
42
41
}
43
42
& __tabs {
Original file line number Diff line number Diff line change @@ -189,16 +189,12 @@ function GroupedStorageGroupsComponent({
189
189
} ;
190
190
191
191
return (
192
- < React . Fragment >
193
- < TableWithControlsLayout . Controls wrapperClassName = { b ( 'controls' ) } >
194
- { renderControls ( ) }
195
- </ TableWithControlsLayout . Controls >
196
- < TableWithControlsLayout >
197
- { error ? < ResponseError error = { error } /> : null }
198
- < TableWithControlsLayout . Table loading = { isLoading } className = { b ( 'groups-wrapper' ) } >
199
- { renderGroups ( ) }
200
- </ TableWithControlsLayout . Table >
201
- </ TableWithControlsLayout >
202
- </ React . Fragment >
192
+ < TableWithControlsLayout >
193
+ < TableWithControlsLayout . Controls > { renderControls ( ) } </ TableWithControlsLayout . Controls >
194
+ { error ? < ResponseError error = { error } /> : null }
195
+ < TableWithControlsLayout . Table loading = { isLoading } className = { b ( 'groups-wrapper' ) } >
196
+ { renderGroups ( ) }
197
+ </ TableWithControlsLayout . Table >
198
+ </ TableWithControlsLayout >
203
199
) ;
204
200
}
Original file line number Diff line number Diff line change @@ -195,17 +195,13 @@ function GroupedStorageNodesComponent({
195
195
} ;
196
196
197
197
return (
198
- < React . Fragment >
199
- < TableWithControlsLayout . Controls wrapperClassName = { b ( 'controls' ) } >
200
- { renderControls ( ) }
201
- </ TableWithControlsLayout . Controls >
202
- < TableWithControlsLayout >
203
- { error ? < ResponseError error = { error } /> : null }
204
- < TableWithControlsLayout . Table loading = { isLoading } className = { b ( 'groups-wrapper' ) } >
205
- { renderGroups ( ) }
206
- </ TableWithControlsLayout . Table >
207
- </ TableWithControlsLayout >
208
- </ React . Fragment >
198
+ < TableWithControlsLayout >
199
+ < TableWithControlsLayout . Controls > { renderControls ( ) } </ TableWithControlsLayout . Controls >
200
+ { error ? < ResponseError error = { error } /> : null }
201
+ < TableWithControlsLayout . Table loading = { isLoading } className = { b ( 'groups-wrapper' ) } >
202
+ { renderGroups ( ) }
203
+ </ TableWithControlsLayout . Table >
204
+ </ TableWithControlsLayout >
209
205
) ;
210
206
}
211
207
Original file line number Diff line number Diff line change 19
19
& __groups-wrapper {
20
20
padding-right : 20px ;
21
21
}
22
-
23
- & __controls {
24
- width : unset ;
25
- margin-right : -40px ;
26
- padding-right : 40px ;
27
- padding-left : 20px ;
28
-
29
- transform : translateX (-20px );
30
- }
31
22
}
Original file line number Diff line number Diff line change 53
53
overflow : hidden ;
54
54
}
55
55
56
- & __controls {
57
- width : 100% ;
58
- }
59
-
60
56
& __table-wrapper {
61
57
width : max-content ;
62
58
}
Original file line number Diff line number Diff line change @@ -303,7 +303,7 @@ export const Tenants = ({additionalTenantsProps}: TenantsProps) => {
303
303
return (
304
304
< div className = { b ( 'table-wrapper' ) } >
305
305
< TableWithControlsLayout >
306
- < TableWithControlsLayout . Controls className = { b ( 'controls' ) } >
306
+ < TableWithControlsLayout . Controls >
307
307
{ renderControls ( ) }
308
308
</ TableWithControlsLayout . Controls >
309
309
{ error ? < ResponseError error = { error } /> : null }
You can’t perform that action at this time.
0 commit comments