Skip to content

Commit

Permalink
Allow classname to be overridden
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Silvester committed Feb 3, 2020
1 parent 0c609d6 commit 942566d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/ui-components/src/icon/labicon.tsx
Expand Up @@ -265,6 +265,7 @@ export class LabIcon implements LabIcon.ILabIcon, VirtualElement.IRenderer {
render,
unrender,
rendererClass = LabIcon.ElementRenderer,
className = '',
_loading = false
}: LabIcon.IOptions & { _loading?: boolean }) {
if (!(name && svgstr)) {
Expand Down Expand Up @@ -299,7 +300,8 @@ export class LabIcon implements LabIcon.ILabIcon, VirtualElement.IRenderer {
}

this.name = name;
this._className = Private.nameToClassName(name);
this._className =
className != undefined ? className : Private.nameToClassName(name);
this.svgstr = svgstr;

this.react = this._initReact();
Expand Down Expand Up @@ -606,6 +608,7 @@ export namespace LabIcon {
*/
export interface IOptions extends IIcon, Partial<VirtualElement.IRenderer> {
rendererClass?: typeof Renderer;
className?: string;
}

/**
Expand Down

0 comments on commit 942566d

Please sign in to comment.