summaryrefslogtreecommitdiffstats
path: root/src/components/AppUpdateInfoBar.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/AppUpdateInfoBar.js')
-rw-r--r--src/components/AppUpdateInfoBar.js24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/components/AppUpdateInfoBar.js b/src/components/AppUpdateInfoBar.js
index f51fe029b..30804262a 100644
--- a/src/components/AppUpdateInfoBar.js
+++ b/src/components/AppUpdateInfoBar.js
@@ -2,8 +2,9 @@ import React, { Component } from 'react';
2import PropTypes from 'prop-types'; 2import PropTypes from 'prop-types';
3import { defineMessages, intlShape } from 'react-intl'; 3import { defineMessages, intlShape } from 'react-intl';
4 4
5import { announcementActions } from '../features/announcements/actions';
6import InfoBar from './ui/InfoBar'; 5import InfoBar from './ui/InfoBar';
6import { GITHUB_FERDI_URL } from '../config';
7import { openExternalUrl } from '../helpers/url-helpers';
7 8
8const messages = defineMessages({ 9const messages = defineMessages({
9 updateAvailable: { 10 updateAvailable: {
@@ -23,25 +24,16 @@ const messages = defineMessages({
23class AppUpdateInfoBar extends Component { 24class AppUpdateInfoBar extends Component {
24 static propTypes = { 25 static propTypes = {
25 onInstallUpdate: PropTypes.func.isRequired, 26 onInstallUpdate: PropTypes.func.isRequired,
26 nextAppReleaseVersion: PropTypes.string,
27 onHide: PropTypes.func.isRequired, 27 onHide: PropTypes.func.isRequired,
28 }; 28 };
29 29
30 static defaultProps = {
31 nextAppReleaseVersion: null,
32 };
33
34 static contextTypes = { 30 static contextTypes = {
35 intl: intlShape, 31 intl: intlShape,
36 }; 32 };
37 33
38 render() { 34 render() {
39 const { intl } = this.context; 35 const { intl } = this.context;
40 const { 36 const { onInstallUpdate, onHide } = this.props;
41 onInstallUpdate,
42 nextAppReleaseVersion,
43 onHide,
44 } = this.props;
45 37
46 return ( 38 return (
47 <InfoBar 39 <InfoBar
@@ -51,12 +43,16 @@ class AppUpdateInfoBar extends Component {
51 onHide={onHide} 43 onHide={onHide}
52 > 44 >
53 <span className="mdi mdi-information" /> 45 <span className="mdi mdi-information" />
54 {intl.formatMessage(messages.updateAvailable)} 46 {intl.formatMessage(messages.updateAvailable)}{' '}
55 {' '}
56 <button 47 <button
57 className="info-bar__inline-button" 48 className="info-bar__inline-button"
58 type="button" 49 type="button"
59 onClick={() => announcementActions.show({ targetVersion: nextAppReleaseVersion })} 50 onClick={() =>
51 openExternalUrl(
52 `${GITHUB_FERDI_URL}/ferdi/blob/develop/CHANGELOG.md`,
53 true,
54 )
55 }
60 > 56 >
61 <u>{intl.formatMessage(messages.changelog)}</u> 57 <u>{intl.formatMessage(messages.changelog)}</u>
62 </button> 58 </button>