|
@@ -2,13 +2,14 @@
|
2
|
2
|
|
3
|
3
|
import PropTypes from 'prop-types';
|
4
|
4
|
import React, { Component } from 'react';
|
5
|
|
-import { connect } from 'react-redux';
|
6
|
5
|
|
7
|
6
|
import { translate, translateToHTML } from '../../base/i18n';
|
8
|
7
|
import { Platform } from '../../base/react';
|
9
|
8
|
|
10
|
9
|
import HideNotificationBarStyle from './HideNotificationBarStyle';
|
11
|
10
|
|
|
11
|
+declare var interfaceConfig: Object;
|
|
12
|
+
|
12
|
13
|
/**
|
13
|
14
|
* The namespace of the CSS styles of UnsupportedMobileBrowser.
|
14
|
15
|
*
|
|
@@ -33,8 +34,10 @@ const _TNS = 'unsupportedBrowser';
|
33
|
34
|
* @type {Array<string>}
|
34
|
35
|
*/
|
35
|
36
|
const _URLS = {
|
36
|
|
- android: 'https://play.google.com/store/apps/details?id=org.jitsi.meet',
|
37
|
|
- ios: 'https://itunes.apple.com/us/app/jitsi-meet/id1165103905'
|
|
37
|
+ android: interfaceConfig.MOBILE_DOWNLOAD_LINK_ANDROID
|
|
38
|
+ || 'https://play.google.com/store/apps/details?id=org.jitsi.meet',
|
|
39
|
+ ios: interfaceConfig.MOBILE_DOWNLOAD_LINK_IOS
|
|
40
|
+ || 'https://itunes.apple.com/us/app/jitsi-meet/id1165103905'
|
38
|
41
|
};
|
39
|
42
|
|
40
|
43
|
/**
|
|
@@ -51,15 +54,6 @@ class UnsupportedMobileBrowser extends Component<*, *> {
|
51
|
54
|
* @static
|
52
|
55
|
*/
|
53
|
56
|
static propTypes = {
|
54
|
|
- /**
|
55
|
|
- * The name of the conference room to be joined upon clicking the
|
56
|
|
- * respective button.
|
57
|
|
- *
|
58
|
|
- * @private
|
59
|
|
- * @type {string}
|
60
|
|
- */
|
61
|
|
- _room: PropTypes.string,
|
62
|
|
-
|
63
|
57
|
/**
|
64
|
58
|
* The function to translate human-readable text.
|
65
|
59
|
*
|
|
@@ -76,18 +70,15 @@ class UnsupportedMobileBrowser extends Component<*, *> {
|
76
|
70
|
* @inheritdoc
|
77
|
71
|
*/
|
78
|
72
|
componentWillMount() {
|
79
|
|
- const joinText
|
80
|
|
- = this.props._room ? 'joinConversation' : 'startConference';
|
81
|
|
-
|
82
|
73
|
// If the user installed the app while this Component was displayed
|
83
|
74
|
// (e.g. the user clicked the Download the App button), then we would
|
84
|
75
|
// like to open the current URL in the mobile app. The only way to do it
|
85
|
76
|
// appears to be a link with an app-specific scheme, not a Universal
|
86
|
77
|
// Link.
|
87
|
|
- const joinURL = `org.jitsi.meet:${window.location.href}`;
|
|
78
|
+ const appScheme = interfaceConfig.MOBILE_APP_SCHEME || 'org.jitsi.meet';
|
|
79
|
+ const joinURL = `${appScheme}:${window.location.href}`;
|
88
|
80
|
|
89
|
81
|
this.setState({
|
90
|
|
- joinText,
|
91
|
82
|
joinURL
|
92
|
83
|
});
|
93
|
84
|
}
|
|
@@ -101,8 +92,10 @@ class UnsupportedMobileBrowser extends Component<*, *> {
|
101
|
92
|
render() {
|
102
|
93
|
const { t } = this.props;
|
103
|
94
|
|
104
|
|
- const downloadButtonClassName
|
|
95
|
+ const openAppButtonClassName
|
105
|
96
|
= `${_SNS}__button ${_SNS}__button_primary`;
|
|
97
|
+ const appName
|
|
98
|
+ = interfaceConfig.ADD_PEOPLE_APP_NAME || interfaceConfig.APP_NAME;
|
106
|
99
|
|
107
|
100
|
return (
|
108
|
101
|
<div className = { _SNS }>
|
|
@@ -115,20 +108,18 @@ class UnsupportedMobileBrowser extends Component<*, *> {
|
115
|
108
|
translateToHTML(
|
116
|
109
|
t,
|
117
|
110
|
`${_TNS}.appNotInstalled`,
|
118
|
|
- { postProcess: 'resolveAppName' })
|
|
111
|
+ { app: appName })
|
119
|
112
|
}
|
120
|
113
|
</p>
|
121
|
|
- <a href = { _URLS[Platform.OS] }>
|
122
|
|
- <button className = { downloadButtonClassName }>
|
123
|
|
- { t(`${_TNS}.downloadApp`) }
|
|
114
|
+ <a href = { this.state.joinURL }>
|
|
115
|
+ <button className = { openAppButtonClassName }>
|
|
116
|
+ { t(`${_TNS}.openApp`,
|
|
117
|
+ { app: appName }) }
|
124
|
118
|
</button>
|
125
|
119
|
</a>
|
126
|
|
- <p className = { `${_SNS}__text ${_SNS}__text_small` }>
|
127
|
|
- { translateToHTML(t, `${_TNS}.appInstalled`) }
|
128
|
|
- </p>
|
129
|
|
- <a href = { this.state.joinURL }>
|
|
120
|
+ <a href = { _URLS[Platform.OS] }>
|
130
|
121
|
<button className = { `${_SNS}__button` }>
|
131
|
|
- { t(`${_TNS}.${this.state.joinText}`) }
|
|
122
|
+ { t(`${_TNS}.downloadApp`) }
|
132
|
123
|
</button>
|
133
|
124
|
</a>
|
134
|
125
|
</div>
|
|
@@ -139,27 +130,4 @@ class UnsupportedMobileBrowser extends Component<*, *> {
|
139
|
130
|
}
|
140
|
131
|
}
|
141
|
132
|
|
142
|
|
-/**
|
143
|
|
- * Maps (parts of) the Redux state to the associated UnsupportedMobileBrowser's
|
144
|
|
- * props.
|
145
|
|
- *
|
146
|
|
- * @param {Object} state - Redux state.
|
147
|
|
- * @private
|
148
|
|
- * @returns {{
|
149
|
|
- * _room: string
|
150
|
|
- * }}
|
151
|
|
- */
|
152
|
|
-function _mapStateToProps(state) {
|
153
|
|
- return {
|
154
|
|
- /**
|
155
|
|
- * The name of the conference room to be joined upon clicking the
|
156
|
|
- * respective button.
|
157
|
|
- *
|
158
|
|
- * @private
|
159
|
|
- * @type {string}
|
160
|
|
- */
|
161
|
|
- _room: state['features/base/conference'].room
|
162
|
|
- };
|
163
|
|
-}
|
164
|
|
-
|
165
|
|
-export default translate(connect(_mapStateToProps)(UnsupportedMobileBrowser));
|
|
133
|
+export default translate(UnsupportedMobileBrowser);
|