@@ -39,8 +39,6 @@ const TILE_HORZ_PADDING: number = 32;
39
39
*/
40
40
const BOTTOM_MARGIN : number = 36 ;
41
41
42
- const LAYOUT_STORAGE_KEY : string = 'comparerOneDriveLayout' ;
43
-
44
42
45
43
export class TilesList extends React . Component < ITilesListProps > {
46
44
private _columnCount : number ;
@@ -53,18 +51,18 @@ export class TilesList extends React.Component<ITilesListProps> {
53
51
super ( props ) ;
54
52
}
55
53
56
- public componentDidUpdate ( prevProps : ITilesListProps ) {
54
+ public componentDidUpdate ( prevProps : ITilesListProps ) : void {
57
55
if ( this . props . filePickerResult !== prevProps . filePickerResult ) {
58
56
this . _listElem . forceUpdate ( ) ;
59
57
}
60
58
}
61
59
62
60
public render ( ) : React . ReactElement < ITilesListProps > {
63
61
return (
64
- < SelectionZone selection = { this . props . selection } onItemInvoked = { ( item : IFile ) => { this . _handleItemInvoked ( item ) ; } } >
62
+ < SelectionZone selection = { this . props . selection } onItemInvoked = { ( item : IFile ) => { this . _handleItemInvoked ( item ) ; } } >
65
63
< FocusZone >
66
64
< List
67
- ref = { ( e :any ) => { this . _listElem = e ; } }
65
+ ref = { ( e : List ) => { this . _listElem = e ; } }
68
66
className = { styles . folderList }
69
67
items = { this . props . items }
70
68
getItemCountForPage = { this . _getItemCountForPage }
@@ -79,20 +77,20 @@ export class TilesList extends React.Component<ITilesListProps> {
79
77
/**
80
78
* Gets called what a file is selected.
81
79
*/
82
- private _handleItemInvoked = ( item : IFile ) => {
83
- // If a file is selected, open the library
84
- if ( item . isFolder ) {
85
- this . props . onFolderOpen ( item ) ;
86
- } else {
87
- // Otherwise, remember it was selected
88
- this . props . onFileSelected ( item ) ;
80
+ private _handleItemInvoked = ( item : IFile ) : void => {
81
+ // If a file is selected, open the library
82
+ if ( item . isFolder ) {
83
+ this . props . onFolderOpen ( item ) ;
84
+ } else {
85
+ // Otherwise, remember it was selected
86
+ this . props . onFileSelected ( item ) ;
87
+ }
89
88
}
90
- }
91
89
92
90
/**
93
91
* Calculates how many items there should be in the page
94
92
*/
95
- private _getItemCountForPage = ( itemIndex : number , surfaceRect : IRectangle ) : number => {
93
+ private _getItemCountForPage = ( itemIndex : number , surfaceRect : IRectangle ) : number => {
96
94
if ( itemIndex === 0 ) {
97
95
this . _columnCount = Math . ceil ( surfaceRect . width / MAX_ROW_HEIGHT ) ;
98
96
this . _columnWidth = Math . floor ( surfaceRect . width / this . _columnCount ) ;
@@ -165,7 +163,7 @@ export class TilesList extends React.Component<ITilesListProps> {
165
163
this . props . onNextPageDataRequest ( ) ;
166
164
return null ;
167
165
}
168
- let isSelected : boolean = this . props . filePickerResult && item . absoluteUrl === this . props . filePickerResult . fileAbsoluteUrl ;
166
+ const isSelected : boolean = this . props . filePickerResult && item . absoluteUrl === this . props . filePickerResult . fileAbsoluteUrl ;
169
167
170
168
// I know this is a lot of divs and spans inside of each other, but my
171
169
// goal was to mimic the HTML and style of the out-of-the-box file picker
@@ -203,7 +201,7 @@ export class TilesList extends React.Component<ITilesListProps> {
203
201
} }
204
202
onItemInvoked = { ( itemInvoked : IFile ) => this . _handleItemInvoked ( itemInvoked ) }
205
203
/>
206
- :
204
+ :
207
205
< DocumentTile
208
206
fileBroserService = { this . props . fileBrowserService }
209
207
item = { item }
@@ -216,7 +214,7 @@ export class TilesList extends React.Component<ITilesListProps> {
216
214
} }
217
215
onItemInvoked = { ( itemInvoked : IFile ) => this . _handleItemInvoked ( itemInvoked ) }
218
216
/>
219
- }
217
+ }
220
218
</ div >
221
219
</ div >
222
220
</ div >
0 commit comments