Skip to content

Commit

Permalink
lowercase filetypeicons (microsoft#14569)
Browse files Browse the repository at this point in the history
* Updating to use latest iconset from latest versioned CDN. All filetypes are lowercase. SVGs for 20_1.5x are now available.

* Change files
  • Loading branch information
bigbadcapers authored and levithomason committed Aug 24, 2020
1 parent 1a66744 commit a9b1123
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"type": "patch",
"comment": "Updating to use latest iconset from latest versioned CDN. All filetypes are lowercase. SVGs for 20_1.5x are now available.",
"packageName": "@uifabric/file-type-icons",
"email": "[email protected]",
"dependentChangeType": "patch",
"date": "2020-08-17T20:35:23.970Z"
}
14 changes: 6 additions & 8 deletions packages/file-type-icons/src/initializeFileTypeIcons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { FileTypeIconMap } from './FileTypeIconMap';
const PNG_SUFFIX = '_png';
const SVG_SUFFIX = '_svg';

const DEFAULT_BASE_URL = 'https://spoprod-a.akamaihd.net/files/fabric-cdn-prod_20200708.002/assets/item-types/';
const DEFAULT_BASE_URL = 'https://spoprod-a.akamaihd.net/files/fabric-cdn-prod_20200817.003/assets/item-types/';
const ICON_SIZES: number[] = [16, 20, 24, 32, 40, 48, 64, 96];

export function initializeFileTypeIcons(baseUrl: string = DEFAULT_BASE_URL, options?: Partial<IIconOptions>): void {
Expand All @@ -28,15 +28,13 @@ function _initializeIcons(baseUrl: string, size: number, options?: Partial<IIcon

// SVGs scale well, so you can generally use the default image.
// 1.5x is a special case where both SVGs and PNGs need a different image.
// Remove if statements when missing image files for 20_1.5x are provided.
if (size !== 20) {
fileTypeIcons[type + size + '_1.5x' + PNG_SUFFIX] = (

fileTypeIcons[type + size + '_1.5x' + PNG_SUFFIX] = (
<img src={baseUrl + size + '_1.5x/' + type + '.png'} height="100%" width="100%" />
);
fileTypeIcons[type + size + '_1.5x' + SVG_SUFFIX] = (
);
fileTypeIcons[type + size + '_1.5x' + SVG_SUFFIX] = (
<img src={baseUrl + size + '_1.5x/' + type + '.svg'} height="100%" width="100%" />
);
}
);

fileTypeIcons[type + size + '_2x' + PNG_SUFFIX] = (
<img src={baseUrl + size + '_2x/' + type + '.png'} height="100%" width="100%" />
Expand Down

0 comments on commit a9b1123

Please sign in to comment.