From 70c4494b254688037c8b7033911d2d5f06e600a2 Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Wed, 5 Jun 2019 17:23:29 +0200 Subject: support app updates also for unauthenticated users --- src/components/AppUpdateInfoBar.js | 66 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 src/components/AppUpdateInfoBar.js (limited to 'src/components/AppUpdateInfoBar.js') diff --git a/src/components/AppUpdateInfoBar.js b/src/components/AppUpdateInfoBar.js new file mode 100644 index 000000000..4fb3a8b71 --- /dev/null +++ b/src/components/AppUpdateInfoBar.js @@ -0,0 +1,66 @@ +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; +import { defineMessages, intlShape } from 'react-intl'; + +import { announcementActions } from '../features/announcements/actions'; +import InfoBar from './ui/InfoBar'; + +const messages = defineMessages({ + updateAvailable: { + id: 'infobar.updateAvailable', + defaultMessage: '!!!A new update for Franz is available.', + }, + changelog: { + id: 'infobar.buttonChangelog', + defaultMessage: '!!!Changelog', + }, + buttonInstallUpdate: { + id: 'infobar.buttonInstallUpdate', + defaultMessage: '!!!Restart & install update', + }, +}); + +class AppUpdateInfoBar extends Component { + static propTypes = { + onInstallUpdate: PropTypes.func.isRequired, + nextAppReleaseVersion: PropTypes.string, + }; + + static defaultProps = { + nextAppReleaseVersion: null, + }; + + static contextTypes = { + intl: intlShape, + }; + + render() { + const { intl } = this.context; + const { + onInstallUpdate, + nextAppReleaseVersion, + } = this.props; + + return ( + + + {intl.formatMessage(messages.updateAvailable)} + {' '} + + + ); + } +} + +export default AppUpdateInfoBar; -- cgit v1.2.3-70-g09d2