From 864bb1d3c5a60af5c3e9d0dc4bc0e93ef6e6f2b8 Mon Sep 17 00:00:00 2001 From: Eric Jinks Date: Fri, 24 Nov 2017 17:05:35 +1000 Subject: [PATCH] Remove ServiceWorkerNotification if no message in state --- src/components/ServiceWorkerNotifications.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/ServiceWorkerNotifications.js b/src/components/ServiceWorkerNotifications.js index 0a1994b..09b8ec2 100644 --- a/src/components/ServiceWorkerNotifications.js +++ b/src/components/ServiceWorkerNotifications.js @@ -13,7 +13,7 @@ const Notification = styled.div` padding: 1rem; min-height: 5rem; transition: transform 0.1s ease-in-out; - transform: translateY(${props => props.message ? '0' : '100%'}); + transform: translateY(${props => (props.message ? '0' : '100%')}); ` const CloseButton = styled.button.attrs({ children: 'x' @@ -25,7 +25,7 @@ const CloseButton = styled.button.attrs({ width: 2.5rem; height: 2.5rem; position: absolute; - right: 1rem;; + right: 1rem; top: 1rem; cursor: pointer; @@ -93,11 +93,11 @@ export default class ServiceWorkerNotifications extends Component { render () { this.props.reloadOnUpdate && this.reloadIfUpdated() - return ( + return this.state.message ? ( {this.state.message} - ) + ) : null } }