diff options
author | Michael Lando <ml636r@att.com> | 2017-08-10 18:21:36 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-08-10 18:21:36 +0000 |
commit | ce07d7cd59425944f85d0fef5126ebeef731bc7b (patch) | |
tree | a0d8bb991aa164e01eb930b23f34d9e27999602a /openecomp-ui/test-utils/MockSVGIcon.js | |
parent | 46f9fd57f24428f6a6fd0d290b0463e188975231 (diff) | |
parent | 644017cb3edd5b7a077a634ffd5daf2fee6bc088 (diff) |
Merge "[SDC] OnBoard with enabled tests and features"
Diffstat (limited to 'openecomp-ui/test-utils/MockSVGIcon.js')
-rw-r--r-- | openecomp-ui/test-utils/MockSVGIcon.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/openecomp-ui/test-utils/MockSVGIcon.js b/openecomp-ui/test-utils/MockSVGIcon.js new file mode 100644 index 0000000000..6ce76cf91a --- /dev/null +++ b/openecomp-ui/test-utils/MockSVGIcon.js @@ -0,0 +1,17 @@ +import React from 'react'; +//import ReactDOMServer from 'react-dom/server'; + +const SVGIcon = ({name, onClick, label, className, iconClassName, labelClassName, labelPosition, color, disabled, ...other}) => { + let colorClass = (color !== '') ? '__' + color : ''; + let classes = `svg-icon-wrapper ${iconClassName} ${className} ${colorClass} ${onClick ? 'clickable' : ''} ${disabled ? 'disabled' : ''} ${labelPosition}`; + + let iconMock = ( + <div {...other} onClick={onClick} className={classes}> + <span className={`svg-icon __${name} ${disabled ? 'disabled' : ''}`} /> + {label && <span className={`svg-icon-label ${labelClassName}`}>{label}</span>} + </div> + ); +// console.log(ReactDOMServer.renderToStaticMarkup(iconMock)); + return iconMock; +}; +export default SVGIcon; |