浏览代码

feat(recording/LiveStream): native ui updates

factor2
Calin-Teodor 2 年前
父节点
当前提交
d9749f3da6

+ 10
- 9
react/features/google-api/components/GoogleSignInButton.native.js 查看文件

@@ -1,9 +1,11 @@
1 1
 // @flow
2 2
 
3 3
 import React from 'react';
4
-import { Image, Text, TouchableOpacity } from 'react-native';
4
+import { Image, TouchableOpacity } from 'react-native';
5 5
 
6 6
 import { translate } from '../../base/i18n';
7
+import Button from '../../base/ui/components/native/Button';
8
+import { BUTTON_TYPES } from '../../base/ui/constants.native';
7 9
 
8 10
 import AbstractGoogleSignInButton from './AbstractGoogleSignInButton';
9 11
 import styles from './styles';
@@ -33,17 +35,16 @@ class GoogleSignInButton extends AbstractGoogleSignInButton {
33 35
      * @returns {ReactElement}
34 36
      */
35 37
     render() {
36
-        const { onClick, signedIn, t } = this.props;
38
+        const { onClick, signedIn } = this.props;
37 39
 
38 40
         if (signedIn) {
39 41
             return (
40
-                <TouchableOpacity
41
-                    onPress = { onClick }
42
-                    style = { styles.signOutButton } >
43
-                    <Text style = { styles.signOutButtonText }>
44
-                        { t('liveStreaming.signOut') }
45
-                    </Text>
46
-                </TouchableOpacity>
42
+                <Button
43
+                    accessibilityLabel = 'liveStreaming.signOut'
44
+                    labelKey = 'liveStreaming.signOut'
45
+                    onClick = { onClick }
46
+                    style = { styles.signOutButton }
47
+                    type = { BUTTON_TYPES.SECONDARY } />
47 48
             );
48 49
         }
49 50
 

+ 4
- 18
react/features/google-api/components/styles.js 查看文件

@@ -1,6 +1,6 @@
1 1
 // @flow
2 2
 
3
-import { ColorPalette, createStyleSheet } from '../../base/styles';
3
+import { createStyleSheet } from '../../base/styles';
4 4
 
5 5
 /**
6 6
  * For styling explanations, see:
@@ -34,22 +34,8 @@ export default createStyleSheet({
34 34
      * Google).
35 35
      */
36 36
     signOutButton: {
37
-        alignItems: 'center',
38
-        borderColor: ColorPalette.lightGrey,
39
-        borderRadius: 3,
40
-        borderWidth: 1,
41
-        color: ColorPalette.white,
42
-        height: BUTTON_HEIGHT,
43
-        justifyContent: 'center'
44
-    },
45
-
46
-    /**
47
-     * Text of the sign out button.
48
-     */
49
-    signOutButtonText: {
50
-        color: ColorPalette.blue,
51
-        fontSize: 14,
52
-        fontWeight: 'bold'
37
+        alignSelf: 'center',
38
+        maxWidth: 104,
39
+        width: 'auto'
53 40
     }
54
-
55 41
 });

+ 45
- 73
react/features/recording/components/LiveStream/native/StreamKeyForm.js 查看文件

@@ -1,11 +1,13 @@
1 1
 import React from 'react';
2
-import { Linking, Text, TouchableOpacity, View } from 'react-native';
2
+import { Linking, Text, View } from 'react-native';
3 3
 
4 4
 import { _abstractMapStateToProps } from '../../../../base/dialog';
5 5
 import { translate } from '../../../../base/i18n';
6 6
 import { connect } from '../../../../base/redux';
7 7
 import { StyleType } from '../../../../base/styles';
8
+import Button from '../../../../base/ui/components/native/Button';
8 9
 import Input from '../../../../base/ui/components/native/Input';
10
+import { BUTTON_TYPES } from '../../../../base/ui/constants.native';
9 11
 import AbstractStreamKeyForm, {
10 12
     type Props as AbstractProps
11 13
 } from '../AbstractStreamKeyForm';
@@ -54,81 +56,51 @@ class StreamKeyForm extends AbstractStreamKeyForm<Props> {
54 56
         const { _dialogStyles, t } = this.props;
55 57
 
56 58
         return (
57
-            <View style = { styles.formWrapper }>
58
-                <Text
59
-                    style = { [
60
-                        _dialogStyles.text,
61
-                        styles.text,
62
-                        styles.streamKeyInputLabel
63
-                    ] }>
64
-                    {
65
-                        t('dialog.streamKey')
66
-                    }
67
-                </Text>
68
-                <Input
69
-                    customStyles = {{ input: styles.streamKeyInput }}
70
-                    onChange = { this._onInputChange }
71
-                    placeholder = { t('liveStreaming.enterStreamKey') }
72
-                    value = { this.props.value } />
73
-                <View style = { styles.formFooter }>
74
-                    {
75
-                        this.state.showValidationError
76
-                            ? <View style = { styles.formFooterItem }>
77
-                                <Text
78
-                                    style = { [
79
-                                        _dialogStyles.text,
80
-                                        styles.warningText
81
-                                    ] }>
82
-                                    { t('liveStreaming.invalidStreamKey') }
83
-                                </Text>
84
-                            </View>
85
-                            : null
86
-                    }
87
-                    <View style = { styles.formFooterItem }>
88
-                        <TouchableOpacity
89
-                            onPress = { this._onOpenHelp }
90
-                            style = { styles.streamKeyHelp } >
91
-                            <Text
92
-                                style = { [
93
-                                    _dialogStyles.text,
94
-                                    styles.text
95
-                                ] }>
96
-                                {
97
-                                    t('liveStreaming.streamIdHelp')
98
-                                }
99
-                            </Text>
100
-                        </TouchableOpacity>
59
+            <>
60
+                <View style = { styles.formWrapper }>
61
+                    <Input
62
+                        customStyles = {{ input: styles.streamKeyInput }}
63
+                        onChange = { this._onInputChange }
64
+                        placeholder = { t('liveStreaming.enterStreamKey') }
65
+                        value = { this.props.value } />
66
+                    <View style = { styles.formValidation }>
67
+                        {
68
+                            this.state.showValidationError
69
+                                ? <View style = { styles.formValidationItem }>
70
+                                    <Text
71
+                                        style = { [
72
+                                            _dialogStyles.text,
73
+                                            styles.warningText
74
+                                        ] }>
75
+                                        { t('liveStreaming.invalidStreamKey') }
76
+                                    </Text>
77
+                                </View>
78
+                                : null
79
+                        }
80
+
101 81
                     </View>
102 82
                 </View>
103
-                <View>
104
-                    <TouchableOpacity onPress = { this._onOpenYoutubeTerms }>
105
-                        <Text
106
-                            style = { [
107
-                                _dialogStyles.text,
108
-                                styles.text,
109
-                                styles.tcText
110
-                            ] }>
111
-                            {
112
-                                t('liveStreaming.youtubeTerms')
113
-                            }
114
-                        </Text>
115
-                    </TouchableOpacity>
116
-                </View>
117
-                <View>
118
-                    <TouchableOpacity onPress = { this._onOpenGooglePrivacyPolicy }>
119
-                        <Text
120
-                            style = { [
121
-                                _dialogStyles.text,
122
-                                styles.text,
123
-                                styles.tcText
124
-                            ] }>
125
-                            {
126
-                                t('liveStreaming.googlePrivacyPolicy')
127
-                            }
128
-                        </Text>
129
-                    </TouchableOpacity>
83
+                <View style = { styles.formButtonsWrapper }>
84
+                    <Button
85
+                        accessibilityLabel = 'liveStreaming.streamIdHelp'
86
+                        labelKey = 'liveStreaming.streamIdHelp'
87
+                        labelStyle = { styles.buttonLabelStyle }
88
+                        onClick = { this._onOpenHelp }
89
+                        type = { BUTTON_TYPES.TERTIARY } />
90
+                    <Button
91
+                        accessibilityLabel = 'liveStreaming.youtubeTerms'
92
+                        labelKey = 'liveStreaming.youtubeTerms'
93
+                        labelStyle = { styles.buttonLabelStyle }
94
+                        onClick = { this._onOpenYoutubeTerms }
95
+                        type = { BUTTON_TYPES.TERTIARY } />
96
+                    <Button
97
+                        accessibilityLabel = 'liveStreaming.googlePrivacyPolicy'
98
+                        labelKey = 'liveStreaming.googlePrivacyPolicy'
99
+                        labelStyle = { styles.buttonLabelStyle }
100
+                        onClick = { this._onOpenGooglePrivacyPolicy }
101
+                        type = { BUTTON_TYPES.TERTIARY } />
130 102
                 </View>
131
-            </View>
103
+            </>
132 104
         );
133 105
     }
134 106
 

+ 17
- 19
react/features/recording/components/LiveStream/native/styles.js 查看文件

@@ -30,15 +30,25 @@ export default createStyleSheet({
30 30
     /**
31 31
      * Wrapper for the last element in the form.
32 32
      */
33
-    formFooter: {
34
-        flexDirection: 'row'
33
+    formValidation: {
34
+        flexDirection: 'row',
35
+        height: BaseTheme.spacing[4]
35 36
     },
36 37
 
37
-    /**
38
-     * Wrapper for individual children in the last element of the form.
39
-     */
40
-    formFooterItem: {
41
-        flex: 1
38
+    formValidationItem: {
39
+        alignSelf: 'flex-start',
40
+        marginVertical: BaseTheme.spacing[1]
41
+    },
42
+
43
+    formButtonsWrapper: {
44
+        alignSelf: 'center',
45
+        display: 'flex',
46
+        maxWidth: 200,
47
+        width: 'auto'
48
+    },
49
+
50
+    buttonLabelStyle: {
51
+        color: BaseTheme.palette.link01
42 52
     },
43 53
 
44 54
     /**
@@ -73,22 +83,10 @@ export default createStyleSheet({
73 83
      */
74 84
     streamKeyInput: {
75 85
         alignSelf: 'stretch',
76
-        borderColor: BaseTheme.palette.ui05,
77
-        borderBottomWidth: 1,
78 86
         color: BaseTheme.palette.text01,
79
-        fontSize: 14,
80
-        height: 40,
81
-        marginBottom: 5,
82 87
         textAlign: 'left'
83 88
     },
84 89
 
85
-    /**
86
-     * Label for the previous field.
87
-     */
88
-    streamKeyInputLabel: {
89
-        alignSelf: 'flex-start'
90
-    },
91
-
92 90
     /**
93 91
      * Custom component to pick a broadcast from the list fetched from Google.
94 92
      */

正在加载...
取消
保存