File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed
catalog/app/containers/Search/Table Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -2,29 +2,26 @@ import * as React from 'react'
2
2
import * as M from '@material-ui/core'
3
3
import * as Lab from '@material-ui/lab'
4
4
5
- interface SkeletonColumn {
5
+ export interface Column {
6
6
key : React . Key
7
7
width : number
8
8
}
9
9
10
- interface SkeletonRow {
10
+ export interface Row {
11
11
key : React . Key
12
- columns : SkeletonColumn [ ]
12
+ columns : Column [ ]
13
13
}
14
14
15
15
const randomColumnWidth = ( min : number = 80 , max : number = 200 ) =>
16
16
min + Math . floor ( Math . random ( ) * ( max - min + 1 ) )
17
17
18
- const createColumns = ( columnsLen : number ) : SkeletonColumn [ ] =>
18
+ const createColumns = ( columnsLen : number ) : Column [ ] =>
19
19
Array . from ( { length : columnsLen } ) . map ( ( _c , key ) => ( {
20
20
key,
21
21
width : randomColumnWidth ( ) ,
22
22
} ) )
23
23
24
- export const useSkeletonSizes = (
25
- rowsLen : number = 30 ,
26
- columnsLen : number = 5 ,
27
- ) : SkeletonRow [ ] =>
24
+ export const useSkeletonSizes = ( rowsLen : number = 30 , columnsLen : number = 5 ) : Row [ ] =>
28
25
React . useMemo (
29
26
( ) =>
30
27
Array . from ( { length : rowsLen } ) . map ( ( _r , key ) => ( {
Original file line number Diff line number Diff line change @@ -269,7 +269,7 @@ const usePackageRowStyles = M.makeStyles((t) => ({
269
269
interface PackageRowProps {
270
270
hit : Hit
271
271
columns : ColumnsMap
272
- skeletons ?: { key : number ; width : number } [ ]
272
+ skeletons ?: Skeleton . Column [ ]
273
273
}
274
274
275
275
function PackageRow ( { columns, hit, skeletons } : PackageRowProps ) {
@@ -1124,7 +1124,7 @@ const useLayoutStyles = M.makeStyles((t) => ({
1124
1124
interface LayoutProps {
1125
1125
hits : readonly Hit [ ]
1126
1126
columns : ColumnsMap
1127
- skeletons : ReturnType < typeof Skeleton . useSkeletonSizes >
1127
+ skeletons : Skeleton . Row [ ]
1128
1128
}
1129
1129
1130
1130
function Layout ( { hits, columns, skeletons } : LayoutProps ) {
You can’t perform that action at this time.
0 commit comments