|
@@ -9,6 +9,8 @@ import {
|
9
|
9
|
View
|
10
|
10
|
} from 'react-native';
|
11
|
11
|
|
|
12
|
+import { getName } from '../../app';
|
|
13
|
+
|
12
|
14
|
import { ColorSchemeRegistry } from '../../base/color-scheme';
|
13
|
15
|
import { translate } from '../../base/i18n';
|
14
|
16
|
import { Icon } from '../../base/font-icons';
|
|
@@ -23,11 +25,12 @@ import {
|
23
|
25
|
import { DialInSummary } from '../../invite';
|
24
|
26
|
import { SettingsView } from '../../settings';
|
25
|
27
|
|
|
28
|
+import { setSideBarVisible } from '../actions';
|
|
29
|
+
|
26
|
30
|
import {
|
27
|
31
|
AbstractWelcomePage,
|
28
|
32
|
_mapStateToProps as _abstractMapStateToProps
|
29
|
33
|
} from './AbstractWelcomePage';
|
30
|
|
-import { setSideBarVisible } from '../actions';
|
31
|
34
|
import LocalVideoTrackUnderlay from './LocalVideoTrackUnderlay';
|
32
|
35
|
import styles, { PLACEHOLDER_TEXT_COLOR } from './styles';
|
33
|
36
|
import VideoSwitch from './VideoSwitch';
|
|
@@ -95,52 +98,13 @@ class WelcomePage extends AbstractWelcomePage {
|
95
|
98
|
* @returns {ReactElement}
|
96
|
99
|
*/
|
97
|
100
|
render() {
|
98
|
|
- const roomnameAccLabel = 'welcomepage.accessibilityLabel.roomname';
|
99
|
|
- const { _headerStyles, t } = this.props;
|
|
101
|
+ const { _reducedUI } = this.props;
|
100
|
102
|
|
101
|
|
- return (
|
102
|
|
- <LocalVideoTrackUnderlay style = { styles.welcomePage }>
|
103
|
|
- <View style = { _headerStyles.page }>
|
104
|
|
- <Header style = { styles.header }>
|
105
|
|
- <TouchableOpacity onPress = { this._onShowSideBar } >
|
106
|
|
- <Icon
|
107
|
|
- name = 'menu'
|
108
|
|
- style = { _headerStyles.headerButtonIcon } />
|
109
|
|
- </TouchableOpacity>
|
110
|
|
- <VideoSwitch />
|
111
|
|
- </Header>
|
112
|
|
- <SafeAreaView style = { styles.roomContainer } >
|
113
|
|
- <View style = { styles.joinControls } >
|
114
|
|
- <TextInput
|
115
|
|
- accessibilityLabel = { t(roomnameAccLabel) }
|
116
|
|
- autoCapitalize = 'none'
|
117
|
|
- autoComplete = 'off'
|
118
|
|
- autoCorrect = { false }
|
119
|
|
- autoFocus = { false }
|
120
|
|
- onBlur = { this._onFieldBlur }
|
121
|
|
- onChangeText = { this._onRoomChange }
|
122
|
|
- onFocus = { this._onFieldFocus }
|
123
|
|
- onSubmitEditing = { this._onJoin }
|
124
|
|
- placeholder = { t('welcomepage.roomname') }
|
125
|
|
- placeholderTextColor = {
|
126
|
|
- PLACEHOLDER_TEXT_COLOR
|
127
|
|
- }
|
128
|
|
- returnKeyType = { 'go' }
|
129
|
|
- style = { styles.textInput }
|
130
|
|
- underlineColorAndroid = 'transparent'
|
131
|
|
- value = { this.state.room } />
|
132
|
|
- {
|
133
|
|
- this._renderHintBox()
|
134
|
|
- }
|
135
|
|
- </View>
|
136
|
|
- </SafeAreaView>
|
137
|
|
- <WelcomePageLists disabled = { this.state._fieldFocused } />
|
138
|
|
- <SettingsView />
|
139
|
|
- <DialInSummary />
|
140
|
|
- </View>
|
141
|
|
- <WelcomePageSideBar />
|
142
|
|
- </LocalVideoTrackUnderlay>
|
143
|
|
- );
|
|
103
|
+ if (_reducedUI) {
|
|
104
|
+ return this._renderReducedUI();
|
|
105
|
+ }
|
|
106
|
+
|
|
107
|
+ return this._renderFullUI();
|
144
|
108
|
}
|
145
|
109
|
|
146
|
110
|
/**
|
|
@@ -272,20 +236,92 @@ class WelcomePage extends AbstractWelcomePage {
|
272
|
236
|
</TouchableHighlight>
|
273
|
237
|
);
|
274
|
238
|
}
|
|
239
|
+
|
|
240
|
+ /**
|
|
241
|
+ * Renders the full welcome page.
|
|
242
|
+ *
|
|
243
|
+ * @returns {ReactElement}
|
|
244
|
+ */
|
|
245
|
+ _renderFullUI() {
|
|
246
|
+ const roomnameAccLabel = 'welcomepage.accessibilityLabel.roomname';
|
|
247
|
+ const { _headerStyles, t } = this.props;
|
|
248
|
+
|
|
249
|
+ return (
|
|
250
|
+ <LocalVideoTrackUnderlay style = { styles.welcomePage }>
|
|
251
|
+ <View style = { _headerStyles.page }>
|
|
252
|
+ <Header style = { styles.header }>
|
|
253
|
+ <TouchableOpacity onPress = { this._onShowSideBar } >
|
|
254
|
+ <Icon
|
|
255
|
+ name = 'menu'
|
|
256
|
+ style = { _headerStyles.headerButtonIcon } />
|
|
257
|
+ </TouchableOpacity>
|
|
258
|
+ <VideoSwitch />
|
|
259
|
+ </Header>
|
|
260
|
+ <SafeAreaView style = { styles.roomContainer } >
|
|
261
|
+ <View style = { styles.joinControls } >
|
|
262
|
+ <TextInput
|
|
263
|
+ accessibilityLabel = { t(roomnameAccLabel) }
|
|
264
|
+ autoCapitalize = 'none'
|
|
265
|
+ autoComplete = 'off'
|
|
266
|
+ autoCorrect = { false }
|
|
267
|
+ autoFocus = { false }
|
|
268
|
+ onBlur = { this._onFieldBlur }
|
|
269
|
+ onChangeText = { this._onRoomChange }
|
|
270
|
+ onFocus = { this._onFieldFocus }
|
|
271
|
+ onSubmitEditing = { this._onJoin }
|
|
272
|
+ placeholder = { t('welcomepage.roomname') }
|
|
273
|
+ placeholderTextColor = {
|
|
274
|
+ PLACEHOLDER_TEXT_COLOR
|
|
275
|
+ }
|
|
276
|
+ returnKeyType = { 'go' }
|
|
277
|
+ style = { styles.textInput }
|
|
278
|
+ underlineColorAndroid = 'transparent'
|
|
279
|
+ value = { this.state.room } />
|
|
280
|
+ {
|
|
281
|
+ this._renderHintBox()
|
|
282
|
+ }
|
|
283
|
+ </View>
|
|
284
|
+ </SafeAreaView>
|
|
285
|
+ <WelcomePageLists disabled = { this.state._fieldFocused } />
|
|
286
|
+ <SettingsView />
|
|
287
|
+ <DialInSummary />
|
|
288
|
+ </View>
|
|
289
|
+ <WelcomePageSideBar />
|
|
290
|
+ </LocalVideoTrackUnderlay>
|
|
291
|
+ );
|
|
292
|
+ }
|
|
293
|
+
|
|
294
|
+ /**
|
|
295
|
+ * Renders a "reduced" version of the welcome page.
|
|
296
|
+ *
|
|
297
|
+ * @returns {ReactElement}
|
|
298
|
+ */
|
|
299
|
+ _renderReducedUI() {
|
|
300
|
+ const { t } = this.props;
|
|
301
|
+
|
|
302
|
+ return (
|
|
303
|
+ <View style = { styles.reducedUIContainer }>
|
|
304
|
+ <Text style = { styles.reducedUIText }>
|
|
305
|
+ { t('welcomepage.reducedUIText', { app: getName() }) }
|
|
306
|
+ </Text>
|
|
307
|
+ </View>
|
|
308
|
+ );
|
|
309
|
+ }
|
275
|
310
|
}
|
276
|
311
|
|
277
|
312
|
/**
|
278
|
313
|
* Maps part of the Redux state to the props of this component.
|
279
|
314
|
*
|
280
|
315
|
* @param {Object} state - The Redux state.
|
281
|
|
- * @returns {{
|
282
|
|
- * _headerStyles: Object
|
283
|
|
- * }}
|
|
316
|
+ * @returns {Object}
|
284
|
317
|
*/
|
285
|
318
|
function _mapStateToProps(state) {
|
|
319
|
+ const { reducedUI } = state['features/base/responsive-ui'];
|
|
320
|
+
|
286
|
321
|
return {
|
287
|
322
|
..._abstractMapStateToProps(state),
|
288
|
|
- _headerStyles: ColorSchemeRegistry.get(state, 'Header')
|
|
323
|
+ _headerStyles: ColorSchemeRegistry.get(state, 'Header'),
|
|
324
|
+ _reducedUI: reducedUI
|
289
|
325
|
};
|
290
|
326
|
}
|
291
|
327
|
|