From 5dd84f9ca68b55e892d0f13f37b284457990a4de Mon Sep 17 00:00:00 2001 From: Sampath Kumar Krishnan Date: Sun, 12 Apr 2020 15:32:17 +0000 Subject: Make update banner dismissable (#564) - Remove the sticky option passed to InfoBar in AppUpdateInfoBar - Use component state to manage visibility of AppUpdateInfoBar in AuthLayout and AppLayout. - InfoBar will be dismissed only for the current session Co-Authored-By: Mahadevan Sreenivasan Co-authored-by: Mahadevan Sreenivasan --- src/components/auth/AuthLayout.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/components/auth') diff --git a/src/components/auth/AuthLayout.js b/src/components/auth/AuthLayout.js index 0c5198583..4783fc6a0 100644 --- a/src/components/auth/AuthLayout.js +++ b/src/components/auth/AuthLayout.js @@ -27,6 +27,10 @@ export default @observer class AuthLayout extends Component { appUpdateIsDownloaded: PropTypes.bool.isRequired, }; + state = { + shouldShowAppUpdateInfoBar: true, + } + static defaultProps = { nextAppReleaseVersion: null, }; @@ -62,10 +66,13 @@ export default @observer class AuthLayout extends Component { {intl.formatMessage(globalMessages.notConnectedToTheInternet)} )} - {appUpdateIsDownloaded && ( + {appUpdateIsDownloaded && this.state.shouldShowAppUpdateInfoBar && ( { + this.setState({ shouldShowAppUpdateInfoBar: false }); + }} /> )} {isOnline && !isAPIHealthy && ( -- cgit v1.2.3-70-g09d2