diff options
author | 2020-04-12 15:32:17 +0000 | |
---|---|---|
committer | 2020-04-12 16:32:17 +0100 | |
commit | 5dd84f9ca68b55e892d0f13f37b284457990a4de (patch) | |
tree | edc80ec0091e06a50fd618184308113eb4bad071 /src/components/layout/AppLayout.js | |
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/layout/AppLayout.js')
-rw-r--r-- | src/components/layout/AppLayout.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/components/layout/AppLayout.js b/src/components/layout/AppLayout.js index fe43c42d2..3b732e602 100644 --- a/src/components/layout/AppLayout.js +++ b/src/components/layout/AppLayout.js | |||
@@ -81,6 +81,10 @@ class AppLayout extends Component { | |||
81 | hasActivatedTrial: PropTypes.bool.isRequired, | 81 | hasActivatedTrial: PropTypes.bool.isRequired, |
82 | }; | 82 | }; |
83 | 83 | ||
84 | state = { | ||
85 | shouldShowAppUpdateInfoBar: true, | ||
86 | } | ||
87 | |||
84 | static defaultProps = { | 88 | static defaultProps = { |
85 | children: [], | 89 | children: [], |
86 | nextAppReleaseVersion: null, | 90 | nextAppReleaseVersion: null, |
@@ -181,10 +185,13 @@ class AppLayout extends Component { | |||
181 | {intl.formatMessage(messages.servicesUpdated)} | 185 | {intl.formatMessage(messages.servicesUpdated)} |
182 | </InfoBar> | 186 | </InfoBar> |
183 | )} | 187 | )} |
184 | {appUpdateIsDownloaded && ( | 188 | { appUpdateIsDownloaded && this.state.shouldShowAppUpdateInfoBar && ( |
185 | <AppUpdateInfoBar | 189 | <AppUpdateInfoBar |
186 | nextAppReleaseVersion={nextAppReleaseVersion} | 190 | nextAppReleaseVersion={nextAppReleaseVersion} |
187 | onInstallUpdate={installAppUpdate} | 191 | onInstallUpdate={installAppUpdate} |
192 | onHide={() => { | ||
193 | this.setState({ shouldShowAppUpdateInfoBar: false }); | ||
194 | }} | ||
188 | /> | 195 | /> |
189 | )} | 196 | )} |
190 | <BasicAuth /> | 197 | <BasicAuth /> |