Skip to content

Commit

Permalink
feature(components): prop-type Button component
Browse files Browse the repository at this point in the history
  • Loading branch information
gnarlex committed Feb 16, 2021
1 parent d9a7b27 commit 3d910c2
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion components/common/Button.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -43,3 +44,19 @@ export default function Button({
</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;

0 comments on commit 3d910c2

Please sign in to comment.