How to use the @bentley/ui-abstract.IconSpecUtilities.getSvgSource function in @bentley/ui-abstract

To help you get started, we’ve selected a few @bentley/ui-abstract 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 imodeljs / imodeljs / ui / core / src / ui-core / icons / IconComponent.tsx View on Github external
export const Icon: React.FunctionComponent = (props: IconProps) => {  // tslint:disable-line:variable-name
  if (!props.iconSpec)
    return null;

  if (typeof props.iconSpec === "string") {
    const svgSource = IconSpecUtilities.getSvgSource(props.iconSpec);
    // if string begins with "svg:" then we assume it was imported (into plugin source file) using webpack loader svg-sprite-loader
    if (svgSource !== undefined)
      return (
        <i>
          
        </i>
      );

    const className = "icon " + props.iconSpec;
    return (<i>);
  }

  return (
    <i>
      {props.iconSpec}
    </i>
</i>