How to use the @uifabric/file-type-icons.initializeFileTypeIcons function in @uifabric/file-type-icons

To help you get started, we’ve selected a few @uifabric/file-type-icons examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OfficeDev / office-ui-fabric-react / apps / fabric-website / src / root.tsx View on Github external
import { registerIcons } from 'office-ui-fabric-react';
import { initializeFileTypeIcons } from '@uifabric/file-type-icons';
import { createSite } from './utilities/createSite';
import * as platformPickerStyles from '@uifabric/example-app-base/lib/components/PlatformPicker/PlatformPicker.module.scss';
import { SiteDefinition } from './SiteDefinition/index';
import { HomePage } from './pages/HomePage/HomePage';
import { NotFoundPage } from './pages/NotFoundPage/NotFoundPage';
import { AndroidLogo, AppleLogo, WebLogo } from './utilities/index';

// TODO: handle redirects

initializeFileTypeIcons('https://static2.sharepointonline.com/files/fabric/assets/item-types-fluent/');

registerIcons({
  icons: {
    'AndroidLogo-platformPicker': AndroidLogo({
      className: platformPickerStyles.icon
    }),
    'AppleLogo-platformPicker': AppleLogo({
      className: platformPickerStyles.icon
    }),
    'WebLogo-platformPicker': WebLogo({
      className: platformPickerStyles.icon
    })
  }
});

createSite(SiteDefinition, [NotFoundPage, HomePage]);