From 5ac46e0b2a1e2a8984816f8e4c7357d2afa5e138 Mon Sep 17 00:00:00 2001 From: EnixCoda Date: Tue, 12 Jun 2018 00:54:34 +0800 Subject: [PATCH] refactor(cx): pass className --- src/components/Icon.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/Icon.js b/src/components/Icon.js index 1cd33f7..c95c76d 100644 --- a/src/components/Icon.js +++ b/src/components/Icon.js @@ -17,6 +17,8 @@ import FileCode from '../assets/icons/octicons/file-code.svg?svgr' import X from '../assets/icons/octicons/x.svg?svgr' import Gear from '../assets/icons/octicons/gear.svg?svgr' +import cx from '../utils/cx' + function getSVGIconComponent(type) { switch (type) { case 'octoface': @@ -63,9 +65,9 @@ function getSVGIconComponent(type) { } } -export default function Icon({ type, ...otherProps }) { +export default function Icon({ type, className, ...otherProps }) { return ( -
+
{preact.h(getSVGIconComponent(type), { width: '100%', height: '100%' })}
)