소스 검색

[RN] WelcomeScreen post-merge changes

master
Bettenbuk Zoltan 7 년 전
부모
커밋
5579464951

+ 1
- 2
react/features/base/known-domains/reducer.js 파일 보기

61
         nextState = Array.from(state);
61
         nextState = Array.from(state);
62
         for (let knownDomain of knownDomains) {
62
         for (let knownDomain of knownDomains) {
63
             knownDomain = knownDomain.toLowerCase();
63
             knownDomain = knownDomain.toLowerCase();
64
-            nextState.indexOf(knownDomain) === -1
65
-                && nextState.push(knownDomain);
64
+            !nextState.includes(knownDomain) && nextState.push(knownDomain);
66
         }
65
         }
67
     }
66
     }
68
 
67
 

+ 2
- 2
react/features/settings/components/native/FormRow.js 파일 보기

25
     /**
25
     /**
26
      * The i18n key of the text label of the form field.
26
      * The i18n key of the text label of the form field.
27
      */
27
      */
28
-    i18nLabel: string,
28
+    label: string,
29
 
29
 
30
     /**
30
     /**
31
      * Invoked to obtain translated strings.
31
      * Invoked to obtain translated strings.
78
                             styles.text,
78
                             styles.text,
79
                             styles.fieldLabelText
79
                             styles.fieldLabelText
80
                         ] } >
80
                         ] } >
81
-                        { t(this.props.i18nLabel) }
81
+                        { t(this.props.label) }
82
                     </Text>
82
                     </Text>
83
                 </View>
83
                 </View>
84
                 <View style = { styles.fieldValueContainer } >
84
                 <View style = { styles.fieldValueContainer } >

+ 3
- 3
react/features/settings/components/native/FormSectionHeader.js 파일 보기

15
     /**
15
     /**
16
      * The i18n key of the text label of the section.
16
      * The i18n key of the text label of the section.
17
      */
17
      */
18
-    i18nLabel: string,
18
+    label: string,
19
 
19
 
20
     /**
20
     /**
21
      * An external style object passed to the component.
21
      * An external style object passed to the component.
41
      * @returns {ReactElement}
41
      * @returns {ReactElement}
42
      */
42
      */
43
     render() {
43
     render() {
44
-        const { i18nLabel, style, t } = this.props;
44
+        const { label, style, t } = this.props;
45
 
45
 
46
         return (
46
         return (
47
             <View
47
             <View
50
                     style
50
                     style
51
                 ] } >
51
                 ] } >
52
                 <Text>
52
                 <Text>
53
-                    { t(i18nLabel) }
53
+                    { t(label) }
54
                 </Text>
54
                 </Text>
55
             </View>
55
             </View>
56
         );
56
         );

+ 7
- 7
react/features/settings/components/native/SettingsView.js 파일 보기

146
             <SafeAreaView style = { styles.settingsForm }>
146
             <SafeAreaView style = { styles.settingsForm }>
147
                 <ScrollView>
147
                 <ScrollView>
148
                     <FormSectionHeader
148
                     <FormSectionHeader
149
-                        i18nLabel = 'settingsView.profileSection' />
149
+                        label = 'settingsView.profileSection' />
150
                     <FormRow
150
                     <FormRow
151
                         fieldSeparator = { true }
151
                         fieldSeparator = { true }
152
-                        i18nLabel = 'settingsView.displayName'>
152
+                        label = 'settingsView.displayName'>
153
                         <TextInput
153
                         <TextInput
154
                             autoCorrect = { false }
154
                             autoCorrect = { false }
155
                             onChangeText = { this._onChangeDisplayName }
155
                             onChangeText = { this._onChangeDisplayName }
156
                             placeholder = 'John Doe'
156
                             placeholder = 'John Doe'
157
                             value = { _settings.displayName } />
157
                             value = { _settings.displayName } />
158
                     </FormRow>
158
                     </FormRow>
159
-                    <FormRow i18nLabel = 'settingsView.email'>
159
+                    <FormRow label = 'settingsView.email'>
160
                         <TextInput
160
                         <TextInput
161
                             autoCapitalize = 'none'
161
                             autoCapitalize = 'none'
162
                             autoCorrect = { false }
162
                             autoCorrect = { false }
166
                             value = { _settings.email } />
166
                             value = { _settings.email } />
167
                     </FormRow>
167
                     </FormRow>
168
                     <FormSectionHeader
168
                     <FormSectionHeader
169
-                        i18nLabel = 'settingsView.conferenceSection' />
169
+                        label = 'settingsView.conferenceSection' />
170
                     <FormRow
170
                     <FormRow
171
                         fieldSeparator = { true }
171
                         fieldSeparator = { true }
172
-                        i18nLabel = 'settingsView.serverURL'>
172
+                        label = 'settingsView.serverURL'>
173
                         <TextInput
173
                         <TextInput
174
                             autoCapitalize = 'none'
174
                             autoCapitalize = 'none'
175
                             autoCorrect = { false }
175
                             autoCorrect = { false }
180
                     </FormRow>
180
                     </FormRow>
181
                     <FormRow
181
                     <FormRow
182
                         fieldSeparator = { true }
182
                         fieldSeparator = { true }
183
-                        i18nLabel = 'settingsView.startWithAudioMuted'>
183
+                        label = 'settingsView.startWithAudioMuted'>
184
                         <Switch
184
                         <Switch
185
                             onValueChange = { this._onStartAudioMutedChange }
185
                             onValueChange = { this._onStartAudioMutedChange }
186
                             value = { _settings.startWithAudioMuted } />
186
                             value = { _settings.startWithAudioMuted } />
187
                     </FormRow>
187
                     </FormRow>
188
-                    <FormRow i18nLabel = 'settingsView.startWithVideoMuted'>
188
+                    <FormRow label = 'settingsView.startWithVideoMuted'>
189
                         <Switch
189
                         <Switch
190
                             onValueChange = { this._onStartVideoMutedChange }
190
                             onValueChange = { this._onStartVideoMutedChange }
191
                             value = { _settings.startWithVideoMuted } />
191
                             value = { _settings.startWithVideoMuted } />

+ 6
- 6
react/features/welcome/components/SideBarItem.js 파일 보기

11
 type Props = {
11
 type Props = {
12
 
12
 
13
     /**
13
     /**
14
-     * The i18n label of the item.
14
+     * The icon of the item.
15
      */
15
      */
16
-    i18Label: string,
16
+    icon: string,
17
 
17
 
18
     /**
18
     /**
19
-     * The icon of the item.
19
+     * The i18n label of the item.
20
      */
20
      */
21
-    icon: string,
21
+    label: string,
22
 
22
 
23
     /**
23
     /**
24
      * The function to be invoked when the item is pressed
24
      * The function to be invoked when the item is pressed
61
      * @returns {ReactElement}
61
      * @returns {ReactElement}
62
      */
62
      */
63
     render() {
63
     render() {
64
-        const { onPress, t } = this.props;
64
+        const { label, onPress, t } = this.props;
65
         const onPressCalculated
65
         const onPressCalculated
66
             = typeof onPress === 'function' ? onPress : this._onOpenURL;
66
             = typeof onPress === 'function' ? onPress : this._onOpenURL;
67
 
67
 
74
                         name = { this.props.icon }
74
                         name = { this.props.icon }
75
                         style = { styles.sideBarItemIcon } />
75
                         style = { styles.sideBarItemIcon } />
76
                     <Text style = { styles.sideBarItemText }>
76
                     <Text style = { styles.sideBarItemText }>
77
-                        { t(this.props.i18Label) }
77
+                        { t(label) }
78
                     </Text>
78
                     </Text>
79
                 </View>
79
                 </View>
80
             </TouchableOpacity>
80
             </TouchableOpacity>

+ 23
- 22
react/features/welcome/components/WelcomePage.native.js 파일 보기

47
         this.state.hintBoxAnimation = new Animated.Value(0);
47
         this.state.hintBoxAnimation = new Animated.Value(0);
48
 
48
 
49
         // Bind event handlers so they are only bound once per instance.
49
         // Bind event handlers so they are only bound once per instance.
50
-        this._getHintBoxStyle = this._getHintBoxStyle.bind(this);
51
         this._onFieldFocusChange = this._onFieldFocusChange.bind(this);
50
         this._onFieldFocusChange = this._onFieldFocusChange.bind(this);
52
         this._onShowSideBar = this._onShowSideBar.bind(this);
51
         this._onShowSideBar = this._onShowSideBar.bind(this);
53
         this._renderHintBox = this._renderHintBox.bind(this);
52
         this._renderHintBox = this._renderHintBox.bind(this);
53
+
54
+        // Specially bind functions to avoid function definition on render.
55
+        this._onFieldBlur = this._onFieldFocusChange.bind(this, false);
56
+        this._onFieldFocus = this._onFieldFocusChange.bind(this, true);
54
     }
57
     }
55
 
58
 
56
     /**
59
     /**
103
                                 autoComplete = { false }
106
                                 autoComplete = { false }
104
                                 autoCorrect = { false }
107
                                 autoCorrect = { false }
105
                                 autoFocus = { false }
108
                                 autoFocus = { false }
106
-                                onBlur = { this._onFieldFocusChange(false) }
109
+                                onBlur = { this._onFieldBlur }
107
                                 onChangeText = { this._onRoomChange }
110
                                 onChangeText = { this._onRoomChange }
108
-                                onFocus = { this._onFieldFocusChange(true) }
111
+                                onFocus = { this._onFieldFocus }
109
                                 onSubmitEditing = { this._onJoin }
112
                                 onSubmitEditing = { this._onJoin }
110
                                 placeholder = { t('welcomepage.roomname') }
113
                                 placeholder = { t('welcomepage.roomname') }
111
                                 placeholderTextColor = {
114
                                 placeholderTextColor = {
149
      *
152
      *
150
      * @private
153
      * @private
151
      * @param {boolean} focused - The focused state of the field.
154
      * @param {boolean} focused - The focused state of the field.
152
-     * @returns {Function}
155
+     * @returns {void}
153
      */
156
      */
154
     _onFieldFocusChange(focused) {
157
     _onFieldFocusChange(focused) {
155
-        return () => {
156
-            focused
157
-                && this.setState({
158
-                    _fieldFocused: true
159
-                });
158
+        focused
159
+            && this.setState({
160
+                _fieldFocused: true
161
+            });
160
 
162
 
161
-            Animated.timing(
162
-                this.state.hintBoxAnimation,
163
-                {
164
-                    duration: 300,
165
-                    toValue: focused ? 1 : 0
166
-                })
167
-                .start(animationState =>
168
-                    animationState.finished
169
-                        && !focused
170
-                        && this.setState({
171
-                            _fieldFocused: false
172
-                        }));
173
-        };
163
+        Animated.timing(
164
+            this.state.hintBoxAnimation,
165
+            {
166
+                duration: 300,
167
+                toValue: focused ? 1 : 0
168
+            })
169
+            .start(animationState =>
170
+                animationState.finished
171
+                    && !focused
172
+                    && this.setState({
173
+                        _fieldFocused: false
174
+                    }));
174
     }
175
     }
175
 
176
 
176
     /**
177
     /**

+ 12
- 8
react/features/welcome/components/WelcomePageSideBar.native.js 파일 보기

45
     /**
45
     /**
46
      * The avatar URL to be rendered.
46
      * The avatar URL to be rendered.
47
      */
47
      */
48
-    _avatar: string,
48
+    _avatarURL: string,
49
 
49
 
50
     /**
50
     /**
51
      * Display name of the local participant.
51
      * Display name of the local participant.
90
                     <Avatar
90
                     <Avatar
91
                         size = { SIDEBAR_AVATAR_SIZE }
91
                         size = { SIDEBAR_AVATAR_SIZE }
92
                         style = { styles.avatar }
92
                         style = { styles.avatar }
93
-                        uri = { this.props._avatar } />
93
+                        uri = { this.props._avatarURL } />
94
                     <Text style = { styles.displayName }>
94
                     <Text style = { styles.displayName }>
95
                         { this.props._displayName }
95
                         { this.props._displayName }
96
                     </Text>
96
                     </Text>
99
                     <ScrollView
99
                     <ScrollView
100
                         style = { styles.itemContainer }>
100
                         style = { styles.itemContainer }>
101
                         <SideBarItem
101
                         <SideBarItem
102
-                            i18Label = 'settings.title'
103
                             icon = 'settings'
102
                             icon = 'settings'
103
+                            label = 'settings.title'
104
                             onPress = { this._onOpenSettings } />
104
                             onPress = { this._onOpenSettings } />
105
                         <SideBarItem
105
                         <SideBarItem
106
-                            i18Label = 'welcomepage.terms'
107
                             icon = 'info'
106
                             icon = 'info'
107
+                            label = 'welcomepage.terms'
108
                             url = { TERMS_URL } />
108
                             url = { TERMS_URL } />
109
                         <SideBarItem
109
                         <SideBarItem
110
-                            i18Label = 'welcomepage.privacy'
111
                             icon = 'info'
110
                             icon = 'info'
111
+                            label = 'welcomepage.privacy'
112
                             url = { PRIVACY_URL } />
112
                             url = { PRIVACY_URL } />
113
                         <SideBarItem
113
                         <SideBarItem
114
-                            i18Label = 'welcomepage.sendFeedback'
115
                             icon = 'info'
114
                             icon = 'info'
115
+                            label = 'welcomepage.sendFeedback'
116
                             url = { SEND_FEEDBACK_URL } />
116
                             url = { SEND_FEEDBACK_URL } />
117
                     </ScrollView>
117
                     </ScrollView>
118
                 </SafeAreaView>
118
                 </SafeAreaView>
153
  *
153
  *
154
  * @param {Object} state - The redux state.
154
  * @param {Object} state - The redux state.
155
  * @protected
155
  * @protected
156
- * @returns {Object}
156
+ * @returns {{
157
+ *     _avatarURL: string,
158
+ *     _displayName: string,
159
+ *     _visible: boolean
160
+ * }}
157
  */
161
  */
158
 function _mapStateToProps(state: Object) {
162
 function _mapStateToProps(state: Object) {
159
     const localParticipant = getLocalParticipant(state);
163
     const localParticipant = getLocalParticipant(state);
160
 
164
 
161
     return {
165
     return {
162
-        _avatar: getAvatarURL(localParticipant),
166
+        _avatarURL: getAvatarURL(localParticipant),
163
         _displayName: getParticipantDisplayName(state, localParticipant.id),
167
         _displayName: getParticipantDisplayName(state, localParticipant.id),
164
         _visible: state['features/welcome'].sideBarVisible
168
         _visible: state['features/welcome'].sideBarVisible
165
     };
169
     };

Loading…
취소
저장