Przeglądaj źródła

rn,welcome-page: use random room name generator

master
Saúl Ibarra Corretgé 5 lat temu
rodzic
commit
d3a26f9b4e

+ 0
- 13
react/features/welcome/components/AbstractWelcomePage.js Wyświetl plik

7
 import { createWelcomePageEvent, sendAnalytics } from '../../analytics';
7
 import { createWelcomePageEvent, sendAnalytics } from '../../analytics';
8
 import { appNavigate } from '../../app';
8
 import { appNavigate } from '../../app';
9
 import { isCalendarEnabled } from '../../calendar-sync';
9
 import { isCalendarEnabled } from '../../calendar-sync';
10
-import { isRoomValid } from '../../base/conference';
11
 
10
 
12
 /**
11
 /**
13
  * {@code AbstractWelcomePage}'s React {@code Component} prop types.
12
  * {@code AbstractWelcomePage}'s React {@code Component} prop types.
155
         clearTimeout(this.state.updateTimeoutId);
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
     _onJoin: () => void;
157
     _onJoin: () => void;
171
 
158
 
172
     /**
159
     /**

+ 8
- 12
react/features/welcome/components/WelcomePage.native.js Wyświetl plik

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

+ 7
- 9
react/features/welcome/components/styles.js Wyświetl plik

4
 
4
 
5
 import { BoxModel, ColorPalette } from '../../base/styles';
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
 export const SIDEBAR_AVATAR_SIZE = 100;
9
 export const SIDEBAR_AVATAR_SIZE = 100;
10
 
10
 
64
         paddingHorizontal: 20
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
      * Join button text style.
68
      * Join button text style.
77
      */
69
      */
91
         textAlign: 'center'
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
      * The welcome screen header style.
93
      * The welcome screen header style.
96
      */
94
      */

Ładowanie…
Anuluj
Zapisz