Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional formats for FileTypeIcon #640

Merged
merged 1 commit into from
Aug 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/controls/fileTypeIcon/FileTypeIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export class FileTypeIcon extends React.Component<IFileTypeIconProps, {}> {
if (iconImage.cdnFallback) {
const iconUrl = `${ICON_CDN_URL}/${iconImage.size.replace("icon", "")}/${iconImage.cdnFallback}.png`;
iconElm = <Icon iconType={IconUIType.image} imageProps={{ src: iconUrl }} />;
} else if (iconImage.cdnFallback) {
} else if (iconImage.image) {
iconElm = <Icon iconType={IconUIType.image} imageProps={{ className: `ms-BrandIcon--${iconImage.size} ms-BrandIcon--${iconImage.image}` }} />;
} else {
// Return a generic image
Expand Down
21 changes: 14 additions & 7 deletions src/controls/fileTypeIcon/IFileTypeIcon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,22 @@ export const ApplicationIconList: IApplicationIcons[] = [
application: ApplicationType.ASPX,
extensions: ['aspx', 'master'],
iconName: 'FileASPX',
imageName: []
imageName: [],
cdnImageName: ['spo']
},
{
application: ApplicationType.Code,
extensions: ['js', 'ts', 'cs'],
iconName: 'FileCode',
imageName: []
imageName: [],
cdnImageName: ['code']
},
{
application: ApplicationType.CSS,
extensions: ['css'],
iconName: 'FileCSS',
imageName: []
imageName: [],
cdnImageName: ['code']
},
{
application: ApplicationType.CSV,
Expand All @@ -98,19 +101,22 @@ export const ApplicationIconList: IApplicationIcons[] = [
application: ApplicationType.HTML,
extensions: ['html'],
iconName: 'FileHTML',
imageName: []
imageName: [],
cdnImageName: ['html']
},
{
application: ApplicationType.Image,
extensions: ['jpg', 'jpeg', 'gif', 'png'],
iconName: 'FileImage',
imageName: []
imageName: [],
cdnImageName: ['photo']
},
{
application: ApplicationType.Mail,
extensions: ['msg'],
iconName: 'Mail',
imageName: []
imageName: [],
cdnImageName: ['email']
},
{
application: ApplicationType.OneNote,
Expand Down Expand Up @@ -157,7 +163,8 @@ export const ApplicationIconList: IApplicationIcons[] = [
application: ApplicationType.SASS,
extensions: ['scss', 'sass'],
iconName: 'FileSass',
imageName: []
imageName: [],
cdnImageName: ['code']
},
{
application: ApplicationType.Visio,
Expand Down
6 changes: 5 additions & 1 deletion src/webparts/controlsTest/ControlsTestWebPart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ export default class ControlsTestWebPart extends BaseClientSideWebPart<IControls
displayMode: this.displayMode,
updateProperty: (value: string) => {
this.properties.title = value;
}
},
totalPages: this.properties.totalPages
}
);

Expand All @@ -51,6 +52,9 @@ export default class ControlsTestWebPart extends BaseClientSideWebPart<IControls
groupFields: [
PropertyPaneTextField('description', {
label: strings.DescriptionFieldLabel
}),
PropertyPaneTextField('totalPages', {
label: 'Total pages in pagination'
})
]
}
Expand Down
1 change: 1 addition & 0 deletions src/webparts/controlsTest/IControlsTestWebPartProps.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export interface IControlsTestWebPartProps {
title: string;
description: string;
totalPages: number;
}
2 changes: 1 addition & 1 deletion src/webparts/controlsTest/components/ControlsTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,7 @@ export default class ControlsTest extends React.Component<IControlsTestProps, IC
<Pagination
currentPage={3}
onChange={(page) => (this._getPage(page))}
totalPages={13}
totalPages={this.props.totalPages || 13}
//limiter={3}
// hideFirstPageJump
//hideLastPageJump
Expand Down
1 change: 1 addition & 0 deletions src/webparts/controlsTest/components/IControlsTestProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface IControlsTestProps {
title: string;
displayMode: DisplayMode;
updateProperty: (value: string) => void;
totalPages?: number;
}

export interface IControlsTestState {
Expand Down