|
@@ -3,7 +3,6 @@ import {
|
3
|
3
|
Animated,
|
4
|
4
|
Keyboard,
|
5
|
5
|
SafeAreaView,
|
6
|
|
- Switch,
|
7
|
6
|
TextInput,
|
8
|
7
|
TouchableHighlight,
|
9
|
8
|
TouchableOpacity,
|
|
@@ -14,7 +13,6 @@ import { connect } from 'react-redux';
|
14
|
13
|
import { translate } from '../../base/i18n';
|
15
|
14
|
import { Icon } from '../../base/font-icons';
|
16
|
15
|
import { MEDIA_TYPE } from '../../base/media';
|
17
|
|
-import { updateProfile } from '../../base/profile';
|
18
|
16
|
import { LoadingIndicator, Header, Text } from '../../base/react';
|
19
|
17
|
import { ColorPalette } from '../../base/styles';
|
20
|
18
|
import {
|
|
@@ -27,10 +25,9 @@ import { AbstractWelcomePage, _mapStateToProps } from './AbstractWelcomePage';
|
27
|
25
|
import { setSideBarVisible } from '../actions';
|
28
|
26
|
import LocalVideoTrackUnderlay from './LocalVideoTrackUnderlay';
|
29
|
27
|
import styles, {
|
30
|
|
- PLACEHOLDER_TEXT_COLOR,
|
31
|
|
- SWITCH_THUMB_COLOR,
|
32
|
|
- SWITCH_UNDER_COLOR
|
|
28
|
+ PLACEHOLDER_TEXT_COLOR
|
33
|
29
|
} from './styles';
|
|
30
|
+import VideoSwitch from './VideoSwitch';
|
34
|
31
|
import WelcomePageLists from './WelcomePageLists';
|
35
|
32
|
import WelcomePageSideBar from './WelcomePageSideBar';
|
36
|
33
|
|
|
@@ -55,7 +52,6 @@ class WelcomePage extends AbstractWelcomePage {
|
55
|
52
|
this._getHintBoxStyle = this._getHintBoxStyle.bind(this);
|
56
|
53
|
this._onFieldFocusChange = this._onFieldFocusChange.bind(this);
|
57
|
54
|
this._onShowSideBar = this._onShowSideBar.bind(this);
|
58
|
|
- this._onStartAudioOnlyChange = this._onStartAudioOnlyChange.bind(this);
|
59
|
55
|
this._renderHintBox = this._renderHintBox.bind(this);
|
60
|
56
|
}
|
61
|
57
|
|
|
@@ -87,8 +83,8 @@ class WelcomePage extends AbstractWelcomePage {
|
87
|
83
|
* @returns {ReactElement}
|
88
|
84
|
*/
|
89
|
85
|
render() {
|
90
|
|
- const { buttonStyle, pageStyle, textStyle } = Header;
|
91
|
|
- const { t, _profile } = this.props;
|
|
86
|
+ const { buttonStyle, pageStyle } = Header;
|
|
87
|
+ const { t } = this.props;
|
92
|
88
|
|
93
|
89
|
return (
|
94
|
90
|
<LocalVideoTrackUnderlay style = { styles.welcomePage }>
|
|
@@ -99,20 +95,7 @@ class WelcomePage extends AbstractWelcomePage {
|
99
|
95
|
name = 'menu'
|
100
|
96
|
style = { buttonStyle } />
|
101
|
97
|
</TouchableOpacity>
|
102
|
|
- <View style = { styles.audioVideoSwitchContainer }>
|
103
|
|
- <Text style = { textStyle } >
|
104
|
|
- { t('welcomepage.audioVideoSwitch.video') }
|
105
|
|
- </Text>
|
106
|
|
- <Switch
|
107
|
|
- onTintColor = { SWITCH_UNDER_COLOR }
|
108
|
|
- onValueChange = { this._onStartAudioOnlyChange }
|
109
|
|
- style = { styles.audioVideoSwitch }
|
110
|
|
- thumbTintColor = { SWITCH_THUMB_COLOR }
|
111
|
|
- value = { _profile.startAudioOnly } />
|
112
|
|
- <Text style = { textStyle } >
|
113
|
|
- { t('welcomepage.audioVideoSwitch.audio') }
|
114
|
|
- </Text>
|
115
|
|
- </View>
|
|
98
|
+ <VideoSwitch />
|
116
|
99
|
</Header>
|
117
|
100
|
<SafeAreaView style = { styles.roomContainer } >
|
118
|
101
|
<View style = { styles.joinControls } >
|
|
@@ -202,22 +185,6 @@ class WelcomePage extends AbstractWelcomePage {
|
202
|
185
|
this.props.dispatch(setSideBarVisible(true));
|
203
|
186
|
}
|
204
|
187
|
|
205
|
|
- /**
|
206
|
|
- * Handles the audio-video switch changes.
|
207
|
|
- *
|
208
|
|
- * @private
|
209
|
|
- * @param {boolean} startAudioOnly - The new startAudioOnly value.
|
210
|
|
- * @returns {void}
|
211
|
|
- */
|
212
|
|
- _onStartAudioOnlyChange(startAudioOnly) {
|
213
|
|
- const { dispatch } = this.props;
|
214
|
|
-
|
215
|
|
- dispatch(updateProfile({
|
216
|
|
- ...this.props._profile,
|
217
|
|
- startAudioOnly
|
218
|
|
- }));
|
219
|
|
- }
|
220
|
|
-
|
221
|
188
|
/**
|
222
|
189
|
* Renders the hint box if necessary.
|
223
|
190
|
*
|