diff options
author | Vitaly Takmazov | 2019-08-14 10:49:03 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-13 10:37:55 +0300 |
commit | 340d8b124edc2b73fce4ab1c150c2a4fffb0c7d3 (patch) | |
tree | 6445dfd3f65389ac5dbed25ad0e9da7b65a29512 /vnext/src/ui/Icon.js | |
parent | 61beab8257b0e1c6a8a00aa0498b7cdefe1c94a6 (diff) |
Icon: load from external sprite
Diffstat (limited to 'vnext/src/ui/Icon.js')
-rw-r--r-- | vnext/src/ui/Icon.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/vnext/src/ui/Icon.js b/vnext/src/ui/Icon.js index 255bba34..af9a0944 100644 --- a/vnext/src/ui/Icon.js +++ b/vnext/src/ui/Icon.js @@ -1,6 +1,9 @@ import React, { memo } from 'react'; import PropTypes from 'prop-types'; +// @ts-ignore +import evilIcons from 'evil-icons/assets/sprite.svg'; + /** * @typedef {Object} IconProps * @property {string} size @@ -19,7 +22,7 @@ function IconElement(props) { var klass = 'icon' + (!props.noFill ? ' icon--' + props.name : '') + size + className; var name = '#' + props.name + '-icon'; - var useTag = '<use xlink:href=' + name + ' />'; + var useTag = `<use xlink:href='${evilIcons}${name}' />`; var Icon = React.createElement('svg', { className: 'icon__cnt', dangerouslySetInnerHTML: { __html: useTag } }); return React.createElement( 'div', |