瀏覽代碼

[RN] Add color scheme support to dialog buttons

j8
Bettenbuk Zoltan 6 年之前
父節點
當前提交
8400d01d75

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

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

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

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

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

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

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

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

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

@@ -66,12 +66,6 @@ export const brandedDialog = createStyleSheet({
66 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 69
     buttonFarLeft: {
76 70
         borderBottomLeftRadius: BORDER_RADIUS
77 71
     },
@@ -185,6 +179,12 @@ ColorSchemeRegistry.register('BottomSheet', {
185 179
  * Color schemed styles for all the component based on the abstract dialog.
186 180
  */
187 181
 ColorSchemeRegistry.register('Dialog', {
182
+    button: {
183
+        backgroundColor: schemeColor('buttonBackground'),
184
+        flex: 1,
185
+        padding: BoxModel.padding * 1.5
186
+    },
187
+
188 188
     /**
189 189
      * Separator line for the buttons in a dialog.
190 190
      */
@@ -193,6 +193,12 @@ ColorSchemeRegistry.register('Dialog', {
193 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 203
      * Style of the close icon on a dialog.
198 204
      */

Loading…
取消
儲存