diff options
Diffstat (limited to 'src/components/AppUpdateInfoBar.js')
-rw-r--r-- | src/components/AppUpdateInfoBar.js | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/src/components/AppUpdateInfoBar.js b/src/components/AppUpdateInfoBar.js deleted file mode 100644 index 3f2b1ae95..000000000 --- a/src/components/AppUpdateInfoBar.js +++ /dev/null | |||
@@ -1,60 +0,0 @@ | |||
1 | import { Component } from 'react'; | ||
2 | import PropTypes from 'prop-types'; | ||
3 | import { defineMessages, injectIntl } from 'react-intl'; | ||
4 | |||
5 | import InfoBar from './ui/InfoBar'; | ||
6 | import { GITHUB_FERDI_URL } from '../config'; | ||
7 | import { openExternalUrl } from '../helpers/url-helpers'; | ||
8 | |||
9 | const messages = defineMessages({ | ||
10 | updateAvailable: { | ||
11 | id: 'infobar.updateAvailable', | ||
12 | defaultMessage: 'A new update for Ferdi is available.', | ||
13 | }, | ||
14 | changelog: { | ||
15 | id: 'infobar.buttonChangelog', | ||
16 | defaultMessage: 'What is new?', | ||
17 | }, | ||
18 | buttonInstallUpdate: { | ||
19 | id: 'infobar.buttonInstallUpdate', | ||
20 | defaultMessage: 'Restart & install update', | ||
21 | }, | ||
22 | }); | ||
23 | |||
24 | class AppUpdateInfoBar extends Component { | ||
25 | static propTypes = { | ||
26 | onInstallUpdate: PropTypes.func.isRequired, | ||
27 | onHide: PropTypes.func.isRequired, | ||
28 | }; | ||
29 | |||
30 | render() { | ||
31 | const { intl } = this.props; | ||
32 | const { onInstallUpdate, onHide } = this.props; | ||
33 | |||
34 | return ( | ||
35 | <InfoBar | ||
36 | type="primary" | ||
37 | ctaLabel={intl.formatMessage(messages.buttonInstallUpdate)} | ||
38 | onClick={onInstallUpdate} | ||
39 | onHide={onHide} | ||
40 | > | ||
41 | <span className="mdi mdi-information" /> | ||
42 | {intl.formatMessage(messages.updateAvailable)}{' '} | ||
43 | <button | ||
44 | className="info-bar__inline-button" | ||
45 | type="button" | ||
46 | onClick={() => | ||
47 | openExternalUrl( | ||
48 | `${GITHUB_FERDI_URL}/ferdi/blob/develop/CHANGELOG.md`, | ||
49 | true, | ||
50 | ) | ||
51 | } | ||
52 | > | ||
53 | <u>{intl.formatMessage(messages.changelog)}</u> | ||
54 | </button> | ||
55 | </InfoBar> | ||
56 | ); | ||
57 | } | ||
58 | } | ||
59 | |||
60 | export default injectIntl(AppUpdateInfoBar); | ||