Library
React / v8 (@fluentui/react)
Describe the feature that you would like added
Overview
Our product (enterprise search in SharePoint, Office.com and Bing) uses @fluentui/react-file-type-icons package for showing file type icons. Currently we are refactoring our code to 1) remove dependencies on global icons set on window and 2) allow to use our own CDN for serving icons.
The issue that we hit is that the package does not export the default CDN URL and does not support constructing pure icon URL (only JSX or raw HTML) from file extension and/or type.
Proposal
- Export
DEFAULT_BASE_URL from package's index as a part of export from initializeFileTypeIcons.tsx. This is to allow clients to switch between default and custom CDN URLs via e.g. flighting.
- Create a new exported function that would return file type icon URL based on
IFileTypeIconOptions data and base URL. This will be similar to existing getFileTypeIconAsHTMLString.ts, but will simply return src URL instead of building HTML string. The function will then be available for use from React without having to use Icon component from Fluent UI v8.
Implementation
Draft PR: #27336
Have you discussed this feature with our team
No response
Additional context
No response
Validations
Library
React / v8 (@fluentui/react)
Describe the feature that you would like added
Overview
Our product (enterprise search in SharePoint, Office.com and Bing) uses
@fluentui/react-file-type-iconspackage for showing file type icons. Currently we are refactoring our code to 1) remove dependencies on global icons set on window and 2) allow to use our own CDN for serving icons.The issue that we hit is that the package does not export the default CDN URL and does not support constructing pure icon URL (only JSX or raw HTML) from file extension and/or type.
Proposal
DEFAULT_BASE_URLfrom package's index as a part of export from initializeFileTypeIcons.tsx. This is to allow clients to switch between default and custom CDN URLs via e.g. flighting.IFileTypeIconOptionsdata and base URL. This will be similar to existing getFileTypeIconAsHTMLString.ts, but will simply returnsrcURL instead of building HTML string. The function will then be available for use from React without having to useIconcomponent from Fluent UI v8.Implementation
Draft PR: #27336
Have you discussed this feature with our team
No response
Additional context
No response
Validations