Add disable prop in IconButton and MenuItem

Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
Ajay Bura
2021-12-24 15:05:56 +05:30
parent 7750366654
commit 246f6caf20
3 changed files with 27 additions and 8 deletions

View File

@@ -9,7 +9,8 @@ import Text from '../text/Text';
const IconButton = React.forwardRef(({
variant, size, type,
tooltip, tooltipPlacement, src, onClick, tabIndex,
tooltip, tooltipPlacement, src,
onClick, tabIndex, disabled,
}, ref) => {
const btn = (
<button
@@ -20,6 +21,7 @@ const IconButton = React.forwardRef(({
// eslint-disable-next-line react/button-has-type
type={type}
tabIndex={tabIndex}
disabled={disabled}
>
<RawIcon size={size} src={src} />
</button>
@@ -43,6 +45,7 @@ IconButton.defaultProps = {
tooltipPlacement: 'top',
onClick: null,
tabIndex: 0,
disabled: false,
};
IconButton.propTypes = {
@@ -54,6 +57,7 @@ IconButton.propTypes = {
src: PropTypes.string.isRequired,
onClick: PropTypes.func,
tabIndex: PropTypes.number,
disabled: PropTypes.bool,
};
export default IconButton;