index.js 524 B

123456789101112131415161718
  1. import React from 'react';
  2. import './index.less';
  3. function GButton(props) {
  4. const { children, className = '', theme = 'theme', size = 'basic', disabled, radius, width, onClick } = props;
  5. return (
  6. <div
  7. style={{ width: width || '' }}
  8. className={`button ${className} ${theme} ${size} ${disabled ? 'disabled' : ''} ${radius ? 'radius' : ''}`}
  9. onClick={e => onClick && onClick(e)}
  10. >
  11. {children}
  12. </div>
  13. );
  14. }
  15. GButton.propTypes = {};
  16. export default GButton;
  17. export const Button = GButton;