Add disable prop in IconButton and MenuItem
Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user