Skip to content
This repository was archived by the owner on Dec 3, 2024. It is now read-only.

Commit 0c434c1

Browse files
committed
Fix placeholder color
1 parent 02338e8 commit 0c434c1

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
More documentation coming..
44

5-
[Try it on Snack](https://snack.expo.io/BkkFRMa_Z)
5+
[Try it on Snack](https://snack.expo.io/HJXlZ7TuW)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-navigation-addon-search-layout",
3-
"version": "0.5.1",
3+
"version": "0.7.0",
44
"main": "index.js",
55
"license": "MIT"
66
}

src/SearchBar.android.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default class SearchBar extends React.PureComponent {
2727
this._textInput = view;
2828
}}
2929
placeholder="Search"
30-
placeholderStyle={styles.searchPlaceholderText}
30+
placeholderTextColor={this.props.placeholderTextColor || '#ccc'}
3131
value={this.state.text}
3232
autoCapitalize="none"
3333
autoCorrect={false}
@@ -57,9 +57,6 @@ const styles = StyleSheet.create({
5757
flex: 1,
5858
flexDirection: 'row',
5959
},
60-
searchPlaceholderText: {
61-
color: '#fff',
62-
},
6360
searchInput: {
6461
flex: 1,
6562
fontSize: 18,

src/SearchBar.ios.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class PlaceholderButtonSearchBar extends React.PureComponent {
4141
<TextInput
4242
editable={false}
4343
placeholder="Search"
44-
placeholderStyle={styles.searchInputPlaceholderText}
44+
placeholderTextColor={this.props.placeholderTextColor || '#ccc'}
4545
style={styles.searchInput}
4646
/>
4747

@@ -118,7 +118,7 @@ export default class SearchBar extends React.PureComponent {
118118
autoCorrect={false}
119119
returnKeyType="search"
120120
placeholder="Search"
121-
placeholderStyle={styles.searchInputPlaceholderText}
121+
placeholderTextColor={this.props.placeholderTextColor || '#ccc'}
122122
onSubmitEditing={this._handleSubmit}
123123
style={styles.searchInput}
124124
/>
@@ -141,7 +141,11 @@ export default class SearchBar extends React.PureComponent {
141141
hitSlop={{ top: 15, bottom: 15, left: 15, right: 20 }}
142142
onLayout={this._handleLayoutCancelButton}
143143
onPress={this._handlePressCancelButton}>
144-
<Text style={{ fontSize: 17, color: this.props.tintColor || '#007AFF' }}>
144+
<Text
145+
style={{
146+
fontSize: 17,
147+
color: this.props.tintColor || '#007AFF',
148+
}}>
145149
Cancel
146150
</Text>
147151
</TouchableOpacity>
@@ -192,7 +196,7 @@ const styles = StyleSheet.create({
192196
height: 30,
193197
width: SearchContainerWidth,
194198
backgroundColor: '#f2f2f2',
195-
borderRadius: 6,
199+
borderRadius: 5,
196200
marginHorizontal: SearchContainerHorizontalMargin,
197201
marginTop: 10,
198202
paddingLeft: 27,
@@ -208,5 +212,4 @@ const styles = StyleSheet.create({
208212
fontSize: 14,
209213
paddingTop: 1,
210214
},
211-
searchInputPlaceholderText: {},
212215
});

src/SearchLayout.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export default class SearchLayout extends React.Component {
3939
<SearchBar
4040
onChangeQuery={this._handleChangeQuery}
4141
onSubmit={this._handleSubmit}
42+
placeholderTextColor={this.props.searchInputPlaceholderTextColor}
4243
underlineColorAndroid={this.props.searchInputUnderlineColorAndroid}
4344
tintColor={
4445
this.props.searchInputTintColor || this.props.headerTintColor

0 commit comments

Comments
 (0)