diff --git a/src/components/Banner.js b/src/components/Banner.js index 3b5a8d66e3aa..4ef13aad42b8 100644 --- a/src/components/Banner.js +++ b/src/components/Banner.js @@ -45,53 +45,57 @@ const defaultProps = { shouldRenderHTML: false, shouldShowIcon: false, shouldShowCloseButton: false, - onClose: () => {}, - onPress: () => {}, + onClose: undefined, + onPress: undefined, containerStyles: [], textStyles: [], }; const Banner = props => ( - {isHovered => ( - - - {props.shouldShowIcon && ( - - - + {(isHovered) => { + const isClickable = props.onClose || props.onPress; + const shouldHighlight = isClickable && isHovered; + return ( + + + {props.shouldShowIcon && ( + + + + )} + { + props.shouldRenderHTML + ? + : {props.text} + } + + {props.shouldShowCloseButton && ( + + + + + )} - { - props.shouldRenderHTML - ? - : {props.text} - } - {props.shouldShowCloseButton && ( - - - - - - )} - - )} + ); + }} );