@@ -2,6 +2,8 @@ import * as React from 'react';
2
2
import { findIndex } from '@microsoft/sp-lodash-subset' ;
3
3
import { IFileTypeIconProps , ApplicationType , ApplicationIconList , IconType , IconSizes , ImageSize , IImageResult , ICON_GENERIC_16 , ICON_GENERIC_48 , ICON_GENERIC_96 } from './IFileTypeIcon' ;
4
4
import * as appInsights from '../../common/appInsights' ;
5
+ import { Icon , IconType as IconUIType } from 'office-ui-fabric-react/lib/components/Icon' ;
6
+ import * as styles from './FileTypeIcon.module.scss' ;
5
7
6
8
const ICON_GENERIC = 'Page' ;
7
9
const ICON_DEFAULT_SIZE = 'icon16' ;
@@ -186,23 +188,23 @@ export class FileTypeIcon extends React.Component<IFileTypeIconProps, {}> {
186
188
const iconImage = this . _getIconImageName ( ) ;
187
189
// Check if the image was found, otherwise a generic image will be returned
188
190
if ( typeof iconImage . image !== 'undefined' && iconImage . image !== null ) {
189
- iconElm = < div style = { { display : 'inline-block' } } className = { `ms-BrandIcon--${ iconImage . size } ms-BrandIcon--${ iconImage . image } ` } > </ div > ;
191
+ iconElm = < Icon iconType = { IconUIType . image } imageProps = { { className : `ms-BrandIcon--${ iconImage . size } ms-BrandIcon--${ iconImage . image } ` } } / >;
190
192
} else {
191
193
// Return a generic image
192
194
let imgElm = < img /> ;
193
195
// Check the size of the generic image which has to be returned
194
196
switch ( iconImage . size ) {
195
197
case 'icon16' :
196
- imgElm = < img src = { ICON_GENERIC_16 } /> ;
198
+ imgElm = < Icon iconType = { IconUIType . image } imageProps = { { src : ICON_GENERIC_16 } } /> ;
197
199
break ;
198
200
case 'icon48' :
199
- imgElm = < img src = { ICON_GENERIC_48 } /> ;
201
+ imgElm = < Icon iconType = { IconUIType . image } imageProps = { { src : ICON_GENERIC_48 } } /> ;
200
202
break ;
201
203
case 'icon96' :
202
- imgElm = < img src = { ICON_GENERIC_96 } /> ;
204
+ imgElm = < Icon iconType = { IconUIType . image } imageProps = { { src : ICON_GENERIC_96 } } /> ;
203
205
break ;
204
206
default :
205
- imgElm = < img src = { ICON_GENERIC_16 } /> ;
207
+ imgElm = < Icon iconType = { IconUIType . image } imageProps = { { src : ICON_GENERIC_16 } } /> ;
206
208
break ;
207
209
}
208
210
@@ -215,7 +217,7 @@ export class FileTypeIcon extends React.Component<IFileTypeIconProps, {}> {
215
217
} else {
216
218
// Return the icon font element
217
219
const iconClass = this . _getIconClassName ( ) ;
218
- iconElm = < i className = { `ms-Icon ms-Icon-- ${ iconClass } ` } aria-hidden = 'true' > </ i > ;
220
+ iconElm = < Icon iconName = { iconClass } / >;
219
221
}
220
222
221
223
// Return the icon element
0 commit comments