diff options
author | Sampath Kumar Krishnan <sampathBlam@users.noreply.github.com> | 2020-04-12 15:32:17 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-12 16:32:17 +0100 |
commit | 5dd84f9ca68b55e892d0f13f37b284457990a4de (patch) | |
tree | edc80ec0091e06a50fd618184308113eb4bad071 /src/components/auth | |
parent | Improve user scripts (#559) (diff) | |
download | ferdium-app-5dd84f9ca68b55e892d0f13f37b284457990a4de.tar.gz ferdium-app-5dd84f9ca68b55e892d0f13f37b284457990a4de.tar.zst ferdium-app-5dd84f9ca68b55e892d0f13f37b284457990a4de.zip |
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 <mahadevan_sv@yahoo.com>
Co-authored-by: Mahadevan Sreenivasan <mahadevan_sv@yahoo.com>
Diffstat (limited to 'src/components/auth')
-rw-r--r-- | src/components/auth/AuthLayout.js | 9 |
1 files changed, 8 insertions, 1 deletions
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 { | |||
27 | appUpdateIsDownloaded: PropTypes.bool.isRequired, | 27 | appUpdateIsDownloaded: PropTypes.bool.isRequired, |
28 | }; | 28 | }; |
29 | 29 | ||
30 | state = { | ||
31 | shouldShowAppUpdateInfoBar: true, | ||
32 | } | ||
33 | |||
30 | static defaultProps = { | 34 | static defaultProps = { |
31 | nextAppReleaseVersion: null, | 35 | nextAppReleaseVersion: null, |
32 | }; | 36 | }; |
@@ -62,10 +66,13 @@ export default @observer class AuthLayout extends Component { | |||
62 | {intl.formatMessage(globalMessages.notConnectedToTheInternet)} | 66 | {intl.formatMessage(globalMessages.notConnectedToTheInternet)} |
63 | </InfoBar> | 67 | </InfoBar> |
64 | )} | 68 | )} |
65 | {appUpdateIsDownloaded && ( | 69 | {appUpdateIsDownloaded && this.state.shouldShowAppUpdateInfoBar && ( |
66 | <AppUpdateInfoBar | 70 | <AppUpdateInfoBar |
67 | nextAppReleaseVersion={nextAppReleaseVersion} | 71 | nextAppReleaseVersion={nextAppReleaseVersion} |
68 | onInstallUpdate={installAppUpdate} | 72 | onInstallUpdate={installAppUpdate} |
73 | onHide={() => { | ||
74 | this.setState({ shouldShowAppUpdateInfoBar: false }); | ||
75 | }} | ||
69 | /> | 76 | /> |
70 | )} | 77 | )} |
71 | {isOnline && !isAPIHealthy && ( | 78 | {isOnline && !isAPIHealthy && ( |