|
@@ -1,12 +1,15 @@
|
1
|
1
|
// @flow
|
2
|
2
|
|
3
|
3
|
import React, { Component } from 'react';
|
|
4
|
+import type { Dispatch } from 'redux';
|
4
|
5
|
|
5
|
6
|
import { createDeepLinkingPageEvent, sendAnalytics } from '../../analytics';
|
|
7
|
+import { isSupportedMobileBrowser } from '../../base/environment';
|
6
|
8
|
import { translate } from '../../base/i18n';
|
7
|
9
|
import { Platform } from '../../base/react';
|
8
|
10
|
import { connect } from '../../base/redux';
|
9
|
11
|
import { DialInSummary } from '../../invite';
|
|
12
|
+import { openWebApp } from '../actions';
|
10
|
13
|
import { _TNS } from '../constants';
|
11
|
14
|
import { generateDeepLinkingURL } from '../functions';
|
12
|
15
|
import { renderPromotionalFooter } from '../renderPromotionalFooter';
|
|
@@ -37,6 +40,11 @@ type Props = {
|
37
|
40
|
*/
|
38
|
41
|
_room: string,
|
39
|
42
|
|
|
43
|
+ /**
|
|
44
|
+ * Used to dispatch actions from the buttons.
|
|
45
|
+ */
|
|
46
|
+ dispatch: Dispatch<any>,
|
|
47
|
+
|
40
|
48
|
/**
|
41
|
49
|
* The function to translate human-readable text.
|
42
|
50
|
*/
|
|
@@ -60,6 +68,7 @@ class DeepLinkingMobilePage extends Component<Props> {
|
60
|
68
|
|
61
|
69
|
// Bind event handlers so they are only bound once per instance.
|
62
|
70
|
this._onDownloadApp = this._onDownloadApp.bind(this);
|
|
71
|
+ this._onLaunchWeb = this._onLaunchWeb.bind(this);
|
63
|
72
|
this._onOpenApp = this._onOpenApp.bind(this);
|
64
|
73
|
}
|
65
|
74
|
|
|
@@ -146,6 +155,16 @@ class DeepLinkingMobilePage extends Component<Props> {
|
146
|
155
|
{ t(`${_TNS}.downloadApp`) }
|
147
|
156
|
</button>
|
148
|
157
|
</a>
|
|
158
|
+ {
|
|
159
|
+ isSupportedMobileBrowser()
|
|
160
|
+ && <a
|
|
161
|
+ onClick = { this._onLaunchWeb }
|
|
162
|
+ target = '_top'>
|
|
163
|
+ <button className = { downloadButtonClassName }>
|
|
164
|
+ { t(`${_TNS}.launchWebButton`) }
|
|
165
|
+ </button>
|
|
166
|
+ </a>
|
|
167
|
+ }
|
149
|
168
|
{ renderPromotionalFooter() }
|
150
|
169
|
<DialInSummary
|
151
|
170
|
className = 'deep-linking-dial-in'
|
|
@@ -205,6 +224,20 @@ class DeepLinkingMobilePage extends Component<Props> {
|
205
|
224
|
'clicked', 'downloadAppButton', { isMobileBrowser: true }));
|
206
|
225
|
}
|
207
|
226
|
|
|
227
|
+ _onLaunchWeb: () => void;
|
|
228
|
+
|
|
229
|
+ /**
|
|
230
|
+ * Handles launch web button clicks.
|
|
231
|
+ *
|
|
232
|
+ * @returns {void}
|
|
233
|
+ */
|
|
234
|
+ _onLaunchWeb() {
|
|
235
|
+ sendAnalytics(
|
|
236
|
+ createDeepLinkingPageEvent(
|
|
237
|
+ 'clicked', 'launchWebButton', { isMobileBrowser: true }));
|
|
238
|
+ this.props.dispatch(openWebApp());
|
|
239
|
+ }
|
|
240
|
+
|
208
|
241
|
_onOpenApp: () => void;
|
209
|
242
|
|
210
|
243
|
/**
|