|
@@ -4,7 +4,7 @@ import { connect } from 'react-redux';
|
4
|
4
|
|
5
|
5
|
import { translate } from '../../base/i18n';
|
6
|
6
|
import { MEDIA_TYPE } from '../../base/media';
|
7
|
|
-import { Link, Text } from '../../base/react';
|
|
7
|
+import { Link, LoadingIndicator, Text } from '../../base/react';
|
8
|
8
|
import { ColorPalette } from '../../base/styles';
|
9
|
9
|
import { createDesiredLocalTracks } from '../../base/tracks';
|
10
|
10
|
|
|
@@ -41,18 +41,24 @@ class WelcomePage extends AbstractWelcomePage {
|
41
|
41
|
static propTypes = AbstractWelcomePage.propTypes;
|
42
|
42
|
|
43
|
43
|
/**
|
44
|
|
- * Creates a video track if not already available.
|
|
44
|
+ * Implements React's {@link Component#componentWillMount()}. Invoked
|
|
45
|
+ * immediately before mounting occurs. Creates a local video track if none
|
|
46
|
+ * is available.
|
45
|
47
|
*
|
46
|
48
|
* @inheritdoc
|
47
|
49
|
* @returns {void}
|
48
|
50
|
*/
|
49
|
51
|
componentWillMount() {
|
|
52
|
+ super.componentWillMount();
|
|
53
|
+
|
50
|
54
|
this.props.dispatch(createDesiredLocalTracks(MEDIA_TYPE.VIDEO));
|
51
|
55
|
}
|
52
|
56
|
|
53
|
57
|
/**
|
54
|
|
- * Renders a prompt for entering a room name.
|
|
58
|
+ * Implements React's {@link Component#render()}. Renders a prompt for
|
|
59
|
+ * entering a room name.
|
55
|
60
|
*
|
|
61
|
+ * @inheritdoc
|
56
|
62
|
* @returns {ReactElement}
|
57
|
63
|
*/
|
58
|
64
|
render() {
|
|
@@ -75,16 +81,9 @@ class WelcomePage extends AbstractWelcomePage {
|
75
|
81
|
style = { styles.textInput }
|
76
|
82
|
underlineColorAndroid = 'transparent'
|
77
|
83
|
value = { this.state.room } />
|
78
|
|
- <TouchableHighlight
|
79
|
|
- accessibilityLabel = { 'Tap to Join.' }
|
80
|
|
- disabled = { this._isJoinDisabled() }
|
81
|
|
- onPress = { this._onJoin }
|
82
|
|
- style = { styles.button }
|
83
|
|
- underlayColor = { ColorPalette.white }>
|
84
|
|
- <Text style = { styles.buttonText }>
|
85
|
|
- { t('welcomepage.join') }
|
86
|
|
- </Text>
|
87
|
|
- </TouchableHighlight>
|
|
84
|
+ {
|
|
85
|
+ this._renderJoinButton()
|
|
86
|
+ }
|
88
|
87
|
</View>
|
89
|
88
|
{
|
90
|
89
|
this._renderLegalese()
|
|
@@ -93,6 +92,50 @@ class WelcomePage extends AbstractWelcomePage {
|
93
|
92
|
);
|
94
|
93
|
}
|
95
|
94
|
|
|
95
|
+ /**
|
|
96
|
+ * Renders the join button.
|
|
97
|
+ *
|
|
98
|
+ * @private
|
|
99
|
+ * @returns {ReactElement}
|
|
100
|
+ */
|
|
101
|
+ _renderJoinButton() {
|
|
102
|
+ let children;
|
|
103
|
+
|
|
104
|
+ /* eslint-disable no-extra-parens */
|
|
105
|
+
|
|
106
|
+ if (this.state.joining) {
|
|
107
|
+ // TouchableHighlight is picky about what its children can be, so
|
|
108
|
+ // wrap it in a native component, i.e. View to avoid having to
|
|
109
|
+ // modify non-native children.
|
|
110
|
+ children = (
|
|
111
|
+ <View>
|
|
112
|
+ <LoadingIndicator />
|
|
113
|
+ </View>
|
|
114
|
+ );
|
|
115
|
+ } else {
|
|
116
|
+ children = (
|
|
117
|
+ <Text style = { styles.buttonText }>
|
|
118
|
+ { this.props.t('welcomepage.join') }
|
|
119
|
+ </Text>
|
|
120
|
+ );
|
|
121
|
+ }
|
|
122
|
+
|
|
123
|
+ /* eslint-enable no-extra-parens */
|
|
124
|
+
|
|
125
|
+ return (
|
|
126
|
+ <TouchableHighlight
|
|
127
|
+ accessibilityLabel = { 'Tap to Join.' }
|
|
128
|
+ disabled = { this._isJoinDisabled() }
|
|
129
|
+ onPress = { this._onJoin }
|
|
130
|
+ style = { styles.button }
|
|
131
|
+ underlayColor = { ColorPalette.white }>
|
|
132
|
+ {
|
|
133
|
+ children
|
|
134
|
+ }
|
|
135
|
+ </TouchableHighlight>
|
|
136
|
+ );
|
|
137
|
+ }
|
|
138
|
+
|
96
|
139
|
/**
|
97
|
140
|
* Renders legal-related content such as Terms of service/use, Privacy
|
98
|
141
|
* policy, etc.
|