浏览代码

[RN] Add color scheme support to dialog buttons

master
Bettenbuk Zoltan 6 年前
父节点
当前提交
8400d01d75

+ 2
- 0
react/features/base/color-scheme/defaultScheme.js 查看文件

14
     'Dialog': {
14
     'Dialog': {
15
         background: ColorPalette.blackBlue,
15
         background: ColorPalette.blackBlue,
16
         border: getRGBAFormat(ColorPalette.white, 0.2),
16
         border: getRGBAFormat(ColorPalette.white, 0.2),
17
+        buttonBackground: ColorPalette.blue,
18
+        buttonLabel: ColorPalette.white,
17
         icon: ColorPalette.white,
19
         icon: ColorPalette.white,
18
         text: ColorPalette.white
20
         text: ColorPalette.white
19
     },
21
     },

+ 2
- 2
react/features/base/dialog/components/native/BaseSubmitDialog.js 查看文件

67
                         disabled = { this.props.okDisabled }
67
                         disabled = { this.props.okDisabled }
68
                         onPress = { this._onSubmit }
68
                         onPress = { this._onSubmit }
69
                         style = { [
69
                         style = { [
70
-                            brandedDialog.button,
70
+                            _dialogStyles.button,
71
                             additionalButtons
71
                             additionalButtons
72
                                 ? null : brandedDialog.buttonFarLeft,
72
                                 ? null : brandedDialog.buttonFarLeft,
73
                             brandedDialog.buttonFarRight
73
                             brandedDialog.buttonFarRight
74
                         ] }>
74
                         ] }>
75
-                        <Text style = { _dialogStyles.text }>
75
+                        <Text style = { _dialogStyles.buttonLabel }>
76
                             { t(this._getSubmitButtonKey()) }
76
                             { t(this._getSubmitButtonKey()) }
77
                         </Text>
77
                         </Text>
78
                     </TouchableOpacity>
78
                     </TouchableOpacity>

+ 2
- 2
react/features/base/dialog/components/native/ConfirmDialog.js 查看文件

63
             <TouchableOpacity
63
             <TouchableOpacity
64
                 onPress = { this._onCancel }
64
                 onPress = { this._onCancel }
65
                 style = { [
65
                 style = { [
66
-                    brandedDialog.button,
66
+                    _dialogStyles.button,
67
                     brandedDialog.buttonFarLeft,
67
                     brandedDialog.buttonFarLeft,
68
                     _dialogStyles.buttonSeparator
68
                     _dialogStyles.buttonSeparator
69
                 ] }>
69
                 ] }>
70
-                <Text style = { _dialogStyles.text }>
70
+                <Text style = { _dialogStyles.buttonLabel }>
71
                     { t(cancelKey || 'dialog.confirmNo') }
71
                     { t(cancelKey || 'dialog.confirmNo') }
72
                 </Text>
72
                 </Text>
73
             </TouchableOpacity>
73
             </TouchableOpacity>

+ 2
- 2
react/features/base/dialog/components/native/InputDialog.js 查看文件

95
                         disabled = { okDisabled }
95
                         disabled = { okDisabled }
96
                         onPress = { this._onSubmitValue }
96
                         onPress = { this._onSubmitValue }
97
                         style = { [
97
                         style = { [
98
-                            brandedDialog.button,
98
+                            _dialogStyles.button,
99
                             brandedDialog.buttonFarLeft,
99
                             brandedDialog.buttonFarLeft,
100
                             brandedDialog.buttonFarRight
100
                             brandedDialog.buttonFarRight
101
                         ] }>
101
                         ] }>
102
-                        <Text style = { _dialogStyles.text }>
102
+                        <Text style = { _dialogStyles.buttonLabel }>
103
                             { t('dialog.Ok') }
103
                             { t('dialog.Ok') }
104
                         </Text>
104
                         </Text>
105
                     </TouchableOpacity>
105
                     </TouchableOpacity>

+ 12
- 6
react/features/base/dialog/components/native/styles.js 查看文件

66
         fontWeight: 'bold'
66
         fontWeight: 'bold'
67
     },
67
     },
68
 
68
 
69
-    button: {
70
-        backgroundColor: ColorPalette.blue,
71
-        flex: 1,
72
-        padding: BoxModel.padding * 1.5
73
-    },
74
-
75
     buttonFarLeft: {
69
     buttonFarLeft: {
76
         borderBottomLeftRadius: BORDER_RADIUS
70
         borderBottomLeftRadius: BORDER_RADIUS
77
     },
71
     },
185
  * Color schemed styles for all the component based on the abstract dialog.
179
  * Color schemed styles for all the component based on the abstract dialog.
186
  */
180
  */
187
 ColorSchemeRegistry.register('Dialog', {
181
 ColorSchemeRegistry.register('Dialog', {
182
+    button: {
183
+        backgroundColor: schemeColor('buttonBackground'),
184
+        flex: 1,
185
+        padding: BoxModel.padding * 1.5
186
+    },
187
+
188
     /**
188
     /**
189
      * Separator line for the buttons in a dialog.
189
      * Separator line for the buttons in a dialog.
190
      */
190
      */
193
         borderRightWidth: 1
193
         borderRightWidth: 1
194
     },
194
     },
195
 
195
 
196
+    buttonLabel: {
197
+        color: schemeColor('buttonLabel'),
198
+        fontSize: MD_FONT_SIZE,
199
+        textAlign: 'center'
200
+    },
201
+
196
     /**
202
     /**
197
      * Style of the close icon on a dialog.
203
      * Style of the close icon on a dialog.
198
      */
204
      */

正在加载...
取消
保存