Browse Source

rn,welcome-page: use random room name generator

efficient_tiling
Saúl Ibarra Corretgé 5 years ago
parent
commit
d3a26f9b4e

+ 0
- 13
react/features/welcome/components/AbstractWelcomePage.js View File

@@ -7,7 +7,6 @@ import type { Dispatch } from 'redux';
7 7
 import { createWelcomePageEvent, sendAnalytics } from '../../analytics';
8 8
 import { appNavigate } from '../../app';
9 9
 import { isCalendarEnabled } from '../../calendar-sync';
10
-import { isRoomValid } from '../../base/conference';
11 10
 
12 11
 /**
13 12
  * {@code AbstractWelcomePage}'s React {@code Component} prop types.
@@ -155,18 +154,6 @@ export class AbstractWelcomePage extends Component<Props, *> {
155 154
         clearTimeout(this.state.updateTimeoutId);
156 155
     }
157 156
 
158
-    /**
159
-     * Determines whether the 'Join' button is (to be) disabled i.e. There's no
160
-     * valid room name typed into the respective text input field.
161
-     *
162
-     * @protected
163
-     * @returns {boolean} If the 'Join' button is (to be) disabled, true;
164
-     * otherwise, false.
165
-     */
166
-    _isJoinDisabled() {
167
-        return this.state.joining || !isRoomValid(this.state.room);
168
-    }
169
-
170 157
     _onJoin: () => void;
171 158
 
172 159
     /**

+ 8
- 12
react/features/welcome/components/WelcomePage.native.js View File

@@ -75,6 +75,8 @@ class WelcomePage extends AbstractWelcomePage {
75 75
     componentDidMount() {
76 76
         super.componentDidMount();
77 77
 
78
+        this._updateRoomname();
79
+
78 80
         const { dispatch } = this.props;
79 81
 
80 82
         if (this.props._settings.startAudioOnly) {
@@ -227,19 +229,12 @@ class WelcomePage extends AbstractWelcomePage {
227 229
             );
228 230
         }
229 231
 
230
-
231
-        const buttonDisabled = this._isJoinDisabled();
232
-
233 232
         return (
234 233
             <TouchableHighlight
235 234
                 accessibilityLabel =
236 235
                     { t('welcomepage.accessibilityLabel.join') }
237
-                disabled = { buttonDisabled }
238 236
                 onPress = { this._onJoin }
239
-                style = { [
240
-                    styles.button,
241
-                    buttonDisabled ? styles.buttonDisabled : null
242
-                ] }
237
+                style = { styles.button }
243 238
                 underlayColor = { ColorPalette.white }>
244 239
                 { children }
245 240
             </TouchableHighlight>
@@ -268,6 +263,9 @@ class WelcomePage extends AbstractWelcomePage {
268 263
                     </Header>
269 264
                     <SafeAreaView style = { styles.roomContainer } >
270 265
                         <View style = { styles.joinControls } >
266
+                            <Text style = { styles.enterRoomText }>
267
+                                { t('welcomepage.roomname') }
268
+                            </Text>
271 269
                             <TextInput
272 270
                                 accessibilityLabel = { t(roomnameAccLabel) }
273 271
                                 autoCapitalize = 'none'
@@ -278,10 +276,8 @@ class WelcomePage extends AbstractWelcomePage {
278 276
                                 onChangeText = { this._onRoomChange }
279 277
                                 onFocus = { this._onFieldFocus }
280 278
                                 onSubmitEditing = { this._onJoin }
281
-                                placeholder = { t('welcomepage.roomname') }
282
-                                placeholderTextColor = {
283
-                                    PLACEHOLDER_TEXT_COLOR
284
-                                }
279
+                                placeholder = { this.state.roomPlaceholder }
280
+                                placeholderTextColor = { PLACEHOLDER_TEXT_COLOR }
285 281
                                 returnKeyType = { 'go' }
286 282
                                 style = { styles.textInput }
287 283
                                 underlineColorAndroid = 'transparent'

+ 7
- 9
react/features/welcome/components/styles.js View File

@@ -4,7 +4,7 @@ import { StyleSheet } from 'react-native';
4 4
 
5 5
 import { BoxModel, ColorPalette } from '../../base/styles';
6 6
 
7
-export const PLACEHOLDER_TEXT_COLOR = 'rgba(255, 255, 255, 0.3)';
7
+export const PLACEHOLDER_TEXT_COLOR = 'rgba(255, 255, 255, 0.5)';
8 8
 
9 9
 export const SIDEBAR_AVATAR_SIZE = 100;
10 10
 
@@ -64,14 +64,6 @@ export default {
64 64
         paddingHorizontal: 20
65 65
     },
66 66
 
67
-    /**
68
-     * Renders the button visually disabled.
69
-     */
70
-    buttonDisabled: {
71
-        backgroundColor: '#cccccc',
72
-        borderColor: '#999999'
73
-    },
74
-
75 67
     /**
76 68
      * Join button text style.
77 69
      */
@@ -91,6 +83,12 @@ export default {
91 83
         textAlign: 'center'
92 84
     },
93 85
 
86
+    enterRoomText: {
87
+        color: TEXT_COLOR,
88
+        fontSize: 18,
89
+        marginBottom: BoxModel.margin
90
+    },
91
+
94 92
     /**
95 93
      * The welcome screen header style.
96 94
      */

Loading…
Cancel
Save