From aca578cb9dfdaed33f91c62ffdf3ef1a456c6a72 Mon Sep 17 00:00:00 2001 From: Haishan Date: Fri, 27 Dec 2019 13:12:49 +0800 Subject: refactor: abstract ButtonWithIcon as a button enhancer --- src/components/StyleGuide.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'src/components/StyleGuide.js') diff --git a/src/components/StyleGuide.js b/src/components/StyleGuide.js index 7b6f53d..63afb54 100644 --- a/src/components/StyleGuide.js +++ b/src/components/StyleGuide.js @@ -1,10 +1,11 @@ import React, { PureComponent } from 'react'; -import PropTypes from 'prop-types'; + +import { Zap } from 'react-feather'; import ToggleSwitch from './ToggleSwitch'; import Input from './Input'; import Switch from './Switch'; -import Button from './Button'; +import Button, { ButtonWithIcon, ButtonPlain } from './Button'; // import Modal from 'c/Modal'; // import APIConfig from 'c/APIConfig'; // import Proxy from 'c/Proxy'; @@ -28,10 +29,9 @@ const optionsRule = [ } ]; -const Pane = ({ children }) =>
{children}
; -Pane.propTypes = { - children: PropTypes.element -}; +const Pane = ({ children, style }) => ( +
{children}
+); class StyleGuide extends PureComponent { render() { @@ -52,7 +52,12 @@ class StyleGuide extends PureComponent { /> -