diff options
Diffstat (limited to 'vnext/src/ui/Icon.js')
-rw-r--r-- | vnext/src/ui/Icon.js | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/vnext/src/ui/Icon.js b/vnext/src/ui/Icon.js index 6d10df16..bc5ce08a 100644 --- a/vnext/src/ui/Icon.js +++ b/vnext/src/ui/Icon.js @@ -1,7 +1,7 @@ -import { createElement, memo } from 'react'; -import PropTypes from 'prop-types'; +import { createElement, memo } from 'react' +import PropTypes from 'prop-types' -import evilIcons from 'evil-icons/assets/sprite.svg'; +import evilIcons from 'evil-icons/assets/sprite.svg' /** * @typedef {object} IconProps @@ -16,18 +16,18 @@ import evilIcons from 'evil-icons/assets/sprite.svg'; * @param {IconProps} props - icon props */ function IconElement(props) { - var size = props.size ? ' icon--' + props.size : ''; - var className = props.className ? ' ' + props.className : ''; - var klass = 'icon' + (!props.noFill ? ' icon--' + props.name : '') + size + className; + var size = props.size ? ' icon--' + props.size : '' + var className = props.className ? ' ' + props.className : '' + var klass = 'icon' + (!props.noFill ? ' icon--' + props.name : '') + size + className - var name = '#' + props.name + '-icon'; - var useTag = `<use xlink:href='${evilIcons}${name}' />`; - var Icon = createElement('svg', { className: 'icon__cnt', dangerouslySetInnerHTML: { __html: useTag } }); + var name = '#' + props.name + '-icon' + var useTag = `<use xlink:href='${evilIcons}${name}' />` + var Icon = createElement('svg', { className: 'icon__cnt', dangerouslySetInnerHTML: { __html: useTag } }) return createElement( 'div', { className: klass }, wrapSpinner(Icon, klass) - ); + ) } /** @@ -40,17 +40,17 @@ function wrapSpinner(Html, klass) { 'div', { className: 'icon__spinner' }, Html - ); + ) } else { - return Html; + return Html } } -export default memo(IconElement); +export default memo(IconElement) IconElement.propTypes = { size: PropTypes.string.isRequired, name: PropTypes.string.isRequired, className: PropTypes.string, noFill: PropTypes.bool -}; +} |