Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

[RN] Add color scheme support to dialog buttons

Bettenbuk Zoltan8400d01d752e
diff --git a/react/features/base/color-scheme/defaultScheme.js b/react/features/base/color-scheme/defaultScheme.js
index 8b8d3d4c50..be5421e211 100644
--- a/react/features/base/color-scheme/defaultScheme.js
+++ b/react/features/base/color-scheme/defaultScheme.js
@@ -14,6 +14,8 @@ export default {
'Dialog': {
background: ColorPalette.blackBlue,
border: getRGBAFormat(ColorPalette.white, 0.2),
+ buttonBackground: ColorPalette.blue,
+ buttonLabel: ColorPalette.white,
icon: ColorPalette.white,
text: ColorPalette.white
},
diff --git a/react/features/base/dialog/components/native/BaseSubmitDialog.js b/react/features/base/dialog/components/native/BaseSubmitDialog.js
index b41bdb3c32..734c8f92b0 100644
--- a/react/features/base/dialog/components/native/BaseSubmitDialog.js
+++ b/react/features/base/dialog/components/native/BaseSubmitDialog.js
@@ -67,12 +67,12 @@ class BaseSubmitDialog<P: Props, S: *> extends BaseDialog<P, S> {
disabled = { this.props.okDisabled }
onPress = { this._onSubmit }
style = { [
- brandedDialog.button,
+ _dialogStyles.button,
additionalButtons
? null : brandedDialog.buttonFarLeft,
brandedDialog.buttonFarRight
] }>
- <Text style = { _dialogStyles.text }>
+ <Text style = { _dialogStyles.buttonLabel }>
{ t(this._getSubmitButtonKey()) }
</Text>
</TouchableOpacity>
diff --git a/react/features/base/dialog/components/native/ConfirmDialog.js b/react/features/base/dialog/components/native/ConfirmDialog.js
index 32cfd8fd33..7ffd6a37b1 100644
--- a/react/features/base/dialog/components/native/ConfirmDialog.js
+++ b/react/features/base/dialog/components/native/ConfirmDialog.js
@@ -63,11 +63,11 @@ class ConfirmDialog extends BaseSubmitDialog<Props, *> {
<TouchableOpacity
onPress = { this._onCancel }
style = { [
- brandedDialog.button,
+ _dialogStyles.button,
brandedDialog.buttonFarLeft,
_dialogStyles.buttonSeparator
] }>
- <Text style = { _dialogStyles.text }>
+ <Text style = { _dialogStyles.buttonLabel }>
{ t(cancelKey || 'dialog.confirmNo') }
</Text>
</TouchableOpacity>
diff --git a/react/features/base/dialog/components/native/InputDialog.js b/react/features/base/dialog/components/native/InputDialog.js
index cf240d9be4..eecfc08769 100644
--- a/react/features/base/dialog/components/native/InputDialog.js
+++ b/react/features/base/dialog/components/native/InputDialog.js
@@ -95,11 +95,11 @@ class InputDialog extends BaseDialog<Props, State> {
disabled = { okDisabled }
onPress = { this._onSubmitValue }
style = { [
- brandedDialog.button,
+ _dialogStyles.button,
brandedDialog.buttonFarLeft,
brandedDialog.buttonFarRight
] }>
- <Text style = { _dialogStyles.text }>
+ <Text style = { _dialogStyles.buttonLabel }>
{ t('dialog.Ok') }
</Text>
</TouchableOpacity>
diff --git a/react/features/base/dialog/components/native/styles.js b/react/features/base/dialog/components/native/styles.js
index 84ecfdc24b..60c11294d1 100644
--- a/react/features/base/dialog/components/native/styles.js
+++ b/react/features/base/dialog/components/native/styles.js
@@ -66,12 +66,6 @@ export const brandedDialog = createStyleSheet({
fontWeight: 'bold'
},
- button: {
- backgroundColor: ColorPalette.blue,
- flex: 1,
- padding: BoxModel.padding * 1.5
- },
-
buttonFarLeft: {
borderBottomLeftRadius: BORDER_RADIUS
},
@@ -185,6 +179,12 @@ ColorSchemeRegistry.register('BottomSheet', {
* Color schemed styles for all the component based on the abstract dialog.
*/
ColorSchemeRegistry.register('Dialog', {
+ button: {
+ backgroundColor: schemeColor('buttonBackground'),
+ flex: 1,
+ padding: BoxModel.padding * 1.5
+ },
+
/**
* Separator line for the buttons in a dialog.
*/
@@ -193,6 +193,12 @@ ColorSchemeRegistry.register('Dialog', {
borderRightWidth: 1
},
+ buttonLabel: {
+ color: schemeColor('buttonLabel'),
+ fontSize: MD_FONT_SIZE,
+ textAlign: 'center'
+ },
+
/**
* Style of the close icon on a dialog.
*/