From 3d910c23670d0f91aa2605be341a341564c51700 Mon Sep 17 00:00:00 2001 From: Alexander Klein Date: Tue, 16 Feb 2021 11:40:38 +0100 Subject: [PATCH] feature(components): prop-type Button component --- components/common/Button.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/components/common/Button.js b/components/common/Button.js index 5e92d0d8..0cdb5fbc 100644 --- a/components/common/Button.js +++ b/components/common/Button.js @@ -1,10 +1,11 @@ import React from 'react'; +import PropTypes from 'prop-types'; import ReactTooltip from 'react-tooltip'; import classNames from 'classnames'; import Icon from './Icon'; import styles from './Button.module.css'; -export default function Button({ +function Button({ type = 'button', icon, size, @@ -43,3 +44,19 @@ export default function Button({ ); } + +Button.propTypes = { + type: PropTypes.oneOf(['button', 'submit', 'reset']), + icon: PropTypes.node, + size: PropTypes.oneOf(['xlarge', 'large', 'medium', 'small', 'xsmall']), + variant: PropTypes.oneOf(['action', 'danger', 'light']), + children: PropTypes.node, + className: PropTypes.string, + tooltip: PropTypes.node, + tooltipId: PropTypes.string, + disabled: PropTypes.bool, + iconRight: PropTypes.bool, + onClick: PropTypes.func, +}; + +export default Button;