From a4e8edd735d3059731463a90305ee88801c6d707 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 6 Dec 2022 12:09:17 -0700 Subject: [PATCH 1/3] move colors to colors file --- src/components/Picker/index.js | 6 +++--- src/styles/colors.js | 3 +++ src/styles/themes/default.js | 1 + src/styles/variables.js | 1 - 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/Picker/index.js b/src/components/Picker/index.js index e49abef260c2..ac86378af8ef 100644 --- a/src/components/Picker/index.js +++ b/src/components/Picker/index.js @@ -8,7 +8,7 @@ import * as Expensicons from '../Icon/Expensicons'; import FormHelpMessage from '../FormHelpMessage'; import Text from '../Text'; import styles from '../../styles/styles'; -import variables from '../../styles/variables'; +import themeColors from '../../styles/themes/default'; import pickerStyles from './pickerStyles'; const propTypes = { @@ -108,12 +108,12 @@ class Picker extends PureComponent { // so we might need to color accordingly so it doesn't blend with the background. this.placeholder = _.isEmpty(this.props.placeholder) ? {} : { ...this.props.placeholder, - color: variables.pickerOptionsTextColor, + color: themeColors.pickerOptionsTextColor, }; this.items = _.map(this.props.items, item => ( { ...item, - color: variables.pickerOptionsTextColor, + color: themeColors.pickerOptionsTextColor, } )); } diff --git a/src/styles/colors.js b/src/styles/colors.js index 484b4716259b..df71ea96f426 100644 --- a/src/styles/colors.js +++ b/src/styles/colors.js @@ -34,6 +34,9 @@ export default { greenDefaultButtonPressed: '#467164', greenDefaultButtonDisabled: '#8BA69E', + // Picker option text color, we set this to avoid white on white dropdowns in Windows + midnight: '#002140', + // DEPRECATED COLORS. Do not reference these colors. Will be deleted in color switch PR. gray1: '#FAFAFA', gray2: '#ECECEC', diff --git a/src/styles/themes/default.js b/src/styles/themes/default.js index 5b9981574b25..cb5140aea633 100644 --- a/src/styles/themes/default.js +++ b/src/styles/themes/default.js @@ -57,6 +57,7 @@ const darkTheme = { heroCard: colors.blue, uploadPreviewActivityIndicator: colors.greenHighlightBackground, checkBox: colors.green, + pickerOptionsTextColor: colors.midnight, }; const oldTheme = { diff --git a/src/styles/variables.js b/src/styles/variables.js index d43a0a29464b..0860d3ff9431 100644 --- a/src/styles/variables.js +++ b/src/styles/variables.js @@ -80,5 +80,4 @@ export default { INACTIVE_LABEL_TRANSLATE_Y: getValueUsingPixelRatio(16, 21), sliderBarHeight: 8, sliderKnobSize: 26, - pickerOptionsTextColor: '#002140', }; From 733e83350cdcf4a61d898204d73ac8c907d82788 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 6 Dec 2022 13:04:24 -0700 Subject: [PATCH 2/3] update items on render --- src/components/Picker/index.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/components/Picker/index.js b/src/components/Picker/index.js index ac86378af8ef..62cb9c2b427e 100644 --- a/src/components/Picker/index.js +++ b/src/components/Picker/index.js @@ -110,12 +110,6 @@ class Picker extends PureComponent { ...this.props.placeholder, color: themeColors.pickerOptionsTextColor, }; - this.items = _.map(this.props.items, item => ( - { - ...item, - color: themeColors.pickerOptionsTextColor, - } - )); } componentDidMount() { @@ -171,7 +165,9 @@ class Picker extends PureComponent { )} ({...item, color: themeColors.pickerOptionsTextColor}))} style={this.props.size === 'normal' ? pickerStyles(this.props.isDisabled) : styles.pickerSmall} useNativeAndroidPickerStyle={false} placeholder={this.placeholder} From 5634f96bb286d188e5d4f1c23194d9b5c3b146ab Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Thu, 8 Dec 2022 12:21:53 -0700 Subject: [PATCH 3/3] rm comment --- src/styles/colors.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/styles/colors.js b/src/styles/colors.js index df71ea96f426..39f9ab7e4acf 100644 --- a/src/styles/colors.js +++ b/src/styles/colors.js @@ -33,8 +33,6 @@ export default { greenDefaultButtonHover: '#2C6755', greenDefaultButtonPressed: '#467164', greenDefaultButtonDisabled: '#8BA69E', - - // Picker option text color, we set this to avoid white on white dropdowns in Windows midnight: '#002140', // DEPRECATED COLORS. Do not reference these colors. Will be deleted in color switch PR.