@@ -39,8 +39,6 @@ const TILE_HORZ_PADDING: number = 32;
3939 */
4040const BOTTOM_MARGIN : number = 36 ;
4141
42- const LAYOUT_STORAGE_KEY : string = 'comparerOneDriveLayout' ;
43-
4442
4543export class TilesList extends React . Component < ITilesListProps > {
4644 private _columnCount : number ;
@@ -53,18 +51,18 @@ export class TilesList extends React.Component<ITilesListProps> {
5351 super ( props ) ;
5452 }
5553
56- public componentDidUpdate ( prevProps : ITilesListProps ) {
54+ public componentDidUpdate ( prevProps : ITilesListProps ) : void {
5755 if ( this . props . filePickerResult !== prevProps . filePickerResult ) {
5856 this . _listElem . forceUpdate ( ) ;
5957 }
6058 }
6159
6260 public render ( ) : React . ReactElement < ITilesListProps > {
6361 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 ) ; } } >
6563 < FocusZone >
6664 < List
67- ref = { ( e :any ) => { this . _listElem = e ; } }
65+ ref = { ( e : List ) => { this . _listElem = e ; } }
6866 className = { styles . folderList }
6967 items = { this . props . items }
7068 getItemCountForPage = { this . _getItemCountForPage }
@@ -79,20 +77,20 @@ export class TilesList extends React.Component<ITilesListProps> {
7977 /**
8078 * Gets called what a file is selected.
8179 */
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+ }
8988 }
90- }
9189
9290 /**
9391 * Calculates how many items there should be in the page
9492 */
95- private _getItemCountForPage = ( itemIndex : number , surfaceRect : IRectangle ) : number => {
93+ private _getItemCountForPage = ( itemIndex : number , surfaceRect : IRectangle ) : number => {
9694 if ( itemIndex === 0 ) {
9795 this . _columnCount = Math . ceil ( surfaceRect . width / MAX_ROW_HEIGHT ) ;
9896 this . _columnWidth = Math . floor ( surfaceRect . width / this . _columnCount ) ;
@@ -165,7 +163,7 @@ export class TilesList extends React.Component<ITilesListProps> {
165163 this . props . onNextPageDataRequest ( ) ;
166164 return null ;
167165 }
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 ;
169167
170168 // I know this is a lot of divs and spans inside of each other, but my
171169 // 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> {
203201 } }
204202 onItemInvoked = { ( itemInvoked : IFile ) => this . _handleItemInvoked ( itemInvoked ) }
205203 />
206- :
204+ :
207205 < DocumentTile
208206 fileBroserService = { this . props . fileBrowserService }
209207 item = { item }
@@ -216,7 +214,7 @@ export class TilesList extends React.Component<ITilesListProps> {
216214 } }
217215 onItemInvoked = { ( itemInvoked : IFile ) => this . _handleItemInvoked ( itemInvoked ) }
218216 />
219- }
217+ }
220218 </ div >
221219 </ div >
222220 </ div >
0 commit comments