diff --git a/src/app/atoms/button/IconButton.jsx b/src/app/atoms/button/IconButton.jsx index 34e2424..f92752e 100644 --- a/src/app/atoms/button/IconButton.jsx +++ b/src/app/atoms/button/IconButton.jsx @@ -16,11 +16,8 @@ import Text from '../text/Text'; const IconButton = React.forwardRef(({ variant, size, type, tooltip, tooltipPlacement, src, onClick, -}, ref) => ( - {tooltip}} - > +}, ref) => { + const btn = ( - -)); + ); + if (tooltip === null) return btn; + return ( + {tooltip}} + > + {btn} + + ); +}); IconButton.defaultProps = { variant: 'surface', size: 'normal', type: 'button', + tooltip: null, tooltipPlacement: 'top', onClick: null, }; @@ -45,7 +52,7 @@ IconButton.propTypes = { variant: PropTypes.oneOf(['surface']), size: PropTypes.oneOf(['normal', 'small', 'extra-small']), type: PropTypes.oneOf(['button', 'submit']), - tooltip: PropTypes.string.isRequired, + tooltip: PropTypes.string, tooltipPlacement: PropTypes.oneOf(['top', 'right', 'bottom', 'left']), src: PropTypes.string.isRequired, onClick: PropTypes.func,