From 55964d2fda5c688937ab5c2755f2b2e6cef8dcb2 Mon Sep 17 00:00:00 2001 From: Miguel Alatzar Date: Wed, 17 Jul 2019 12:56:25 -0700 Subject: [PATCH] Add placeholderTextColor when using placeholders (#2976) --- .../edit_channel_info/edit_channel_info.js | 3 ++- .../post_textbox/post_textbox_base.js | 3 +-- .../text_input_with_localized_placeholder.js | 3 +++ .../widgets/settings/text_setting.js | 1 + .../__snapshots__/forgot_password.test.js.snap | 2 ++ app/screens/forgot_password/forgot_password.js | 3 +++ app/screens/login/login.js | 7 +++++-- app/screens/select_server/select_server.js | 2 ++ package-lock.json | 18 +++--------------- 9 files changed, 22 insertions(+), 20 deletions(-) diff --git a/app/components/edit_channel_info/edit_channel_info.js b/app/components/edit_channel_info/edit_channel_info.js index 028240bdc..70871ab9a 100644 --- a/app/components/edit_channel_info/edit_channel_info.js +++ b/app/components/edit_channel_info/edit_channel_info.js @@ -12,6 +12,8 @@ import { } from 'react-native'; import {KeyboardAwareScrollView} from 'react-native-keyboard-aware-scroll-view'; +import {General} from 'mattermost-redux/constants'; + import ErrorText from 'app/components/error_text'; import FormattedText from 'app/components/formatted_text'; import Loading from 'app/components/loading'; @@ -19,7 +21,6 @@ import StatusBar from 'app/components/status_bar'; import TextInputWithLocalizedPlaceholder from 'app/components/text_input_with_localized_placeholder'; import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; -import {General} from 'mattermost-redux/constants'; import {getShortenedURL} from 'app/utils/url'; import {t} from 'app/utils/i18n'; diff --git a/app/components/post_textbox/post_textbox_base.js b/app/components/post_textbox/post_textbox_base.js index f129c7d74..0fa6403b8 100644 --- a/app/components/post_textbox/post_textbox_base.js +++ b/app/components/post_textbox/post_textbox_base.js @@ -32,7 +32,6 @@ import {t} from 'app/utils/i18n'; import {confirmOutOfOfficeDisabled} from 'app/utils/status'; import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; -const PLACEHOLDER_COLOR = changeOpacity('#000', 0.5); const {RNTextInputReset} = NativeModules; export default class PostTextBoxBase extends PureComponent { @@ -617,7 +616,7 @@ export default class PostTextBoxBase extends PureComponent { onChangeText={this.handleTextChange} onSelectionChange={this.handlePostDraftSelectionChanged} placeholder={intl.formatMessage(placeholder, {channelDisplayName})} - placeholderTextColor={PLACEHOLDER_COLOR} + placeholderTextColor={changeOpacity('#000', 0.5)} multiline={true} blurOnSubmit={false} underlineColorAndroid='transparent' diff --git a/app/components/text_input_with_localized_placeholder.js b/app/components/text_input_with_localized_placeholder.js index 431ade37c..771721587 100644 --- a/app/components/text_input_with_localized_placeholder.js +++ b/app/components/text_input_with_localized_placeholder.js @@ -6,6 +6,8 @@ import PropTypes from 'prop-types'; import {intlShape} from 'react-intl'; import {TextInput} from 'react-native'; +import {changeOpacity} from 'app/utils/theme'; + export default class TextInputWithLocalizedPlaceholder extends PureComponent { static propTypes = { ...TextInput.propTypes, @@ -37,6 +39,7 @@ export default class TextInputWithLocalizedPlaceholder extends PureComponent { ref='input' {...otherProps} placeholder={placeholderString} + placeholderTextColor={changeOpacity('#000', 0.5)} disableFullscreenUI={true} /> ); diff --git a/app/components/widgets/settings/text_setting.js b/app/components/widgets/settings/text_setting.js index e913fd7b0..87b1dd335 100644 --- a/app/components/widgets/settings/text_setting.js +++ b/app/components/widgets/settings/text_setting.js @@ -151,6 +151,7 @@ export default class TextSetting extends PureComponent {