From da64cac4147671714bba6161682b817e871f4003 Mon Sep 17 00:00:00 2001 From: diro Date: Tue, 6 Jun 2017 20:45:56 +0800 Subject: [PATCH 1/3] fix the wrong iconName --- src/routes/UIElement/iconfont/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/UIElement/iconfont/index.js b/src/routes/UIElement/iconfont/index.js index e15ff0c..96557b7 100644 --- a/src/routes/UIElement/iconfont/index.js +++ b/src/routes/UIElement/iconfont/index.js @@ -25,7 +25,7 @@ const localRequireSVGIcons = [ ] const IcoPage = () =>
- +

Colorful Icon

    {colorfulIcons.map(item =>
  • From fe8527e72ebed7c8d341d31a846df2d98f6e6ad9 Mon Sep 17 00:00:00 2001 From: diro Date: Tue, 6 Jun 2017 21:08:42 +0800 Subject: [PATCH 2/3] enable the custom ClassName --- src/components/Iconfont/Iconfont.js | 33 ++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/src/components/Iconfont/Iconfont.js b/src/components/Iconfont/Iconfont.js index 1c54eff..9b48342 100644 --- a/src/components/Iconfont/Iconfont.js +++ b/src/components/Iconfont/Iconfont.js @@ -1,21 +1,38 @@ import React from 'react' import PropTypes from 'prop-types' +import classnames from 'classnames' import './iconfont.less' -const Iconfont = ({ type, colorful }) => { +const Iconfont = ({ type, colorful, className }) => { + const propsClassName = className; + + const csSvg = classnames( + { 'colorful-icon': true }, + { [`${propsClassName}`]: className !== undefined }, + ); + if (colorful) { - return (