File tree Expand file tree Collapse file tree 7 files changed +23
-47
lines changed
components/TableWithControlsLayout Expand file tree Collapse file tree 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');
88interface TableWithControlsLayoutItemProps {
99 children : React . ReactNode ;
1010 className ?: string ;
11- wrapperClassName ?: string ;
1211}
1312
1413interface TableProps extends TableWithControlsLayoutItemProps {
@@ -25,10 +24,9 @@ export const TableWithControlsLayout = ({
2524TableWithControlsLayout . Controls = function TableControls ( {
2625 children,
2726 className,
28- wrapperClassName,
2927} : TableWithControlsLayoutItemProps ) {
3028 return (
31- < div className = { b ( 'controls-wrapper' , wrapperClassName ) } >
29+ < div className = { b ( 'controls-wrapper' ) } >
3230 < div className = { b ( 'controls' , className ) } > { children } </ div >
3331 </ div >
3432 ) ;
Original file line number Diff line number Diff line change 11@use ' ../../styles/mixins.scss' ;
22
33.ydb-cluster {
4+ --cluster-side-padding : var (--g-spacing-5 );
45 position : relative ;
56
6- display : flex ;
77 overflow : auto ;
8- flex-grow : 1 ;
9- flex-direction : column ;
108
9+ width : 100% ;
1110 height : 100% ;
12- padding : 0 20 px ;
11+ padding : 0 var ( --cluster-side-padding ) ;
1312
1413 & __header {
1514 position : sticky ;
3332 z-index : 3 ;
3433
3534 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 ) ;
3938
40- transform : translateX (-20 px );
39+ transform : translateX (calc ( var ( --cluster-side-padding ) * -1 ) );
4140 @include mixins .sticky-top ();
4241 }
4342 & __tabs {
Original file line number Diff line number Diff line change @@ -189,16 +189,12 @@ function GroupedStorageGroupsComponent({
189189 } ;
190190
191191 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 >
203199 ) ;
204200}
Original file line number Diff line number Diff line change @@ -195,17 +195,13 @@ function GroupedStorageNodesComponent({
195195 } ;
196196
197197 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 >
209205 ) ;
210206}
211207
Original file line number Diff line number Diff line change 1919 & __groups-wrapper {
2020 padding-right : 20px ;
2121 }
22-
23- & __controls {
24- width : unset ;
25- margin-right : -40px ;
26- padding-right : 40px ;
27- padding-left : 20px ;
28-
29- transform : translateX (-20px );
30- }
3122}
Original file line number Diff line number Diff line change 5353 overflow : hidden ;
5454 }
5555
56- & __controls {
57- width : 100% ;
58- }
59-
6056 & __table-wrapper {
6157 width : max-content ;
6258 }
Original file line number Diff line number Diff line change @@ -303,7 +303,7 @@ export const Tenants = ({additionalTenantsProps}: TenantsProps) => {
303303 return (
304304 < div className = { b ( 'table-wrapper' ) } >
305305 < TableWithControlsLayout >
306- < TableWithControlsLayout . Controls className = { b ( 'controls' ) } >
306+ < TableWithControlsLayout . Controls >
307307 { renderControls ( ) }
308308 </ TableWithControlsLayout . Controls >
309309 { error ? < ResponseError error = { error } /> : null }
You can’t perform that action at this time.
0 commit comments