From dda2c365b595cf1fb00a358c266be1647031d12e Mon Sep 17 00:00:00 2001 From: Mustafa Buyukcelebi Date: Wed, 27 Feb 2019 23:47:10 +0300 Subject: [PATCH] Fixed pr comment requirements --- src/components/posts/view/postsView.js | 9 +-- .../searchInput/view/searchInputStyles.js | 4 +- .../searchInput/view/searchInputView.js | 43 +++++++------- .../searchModal/view/searchModalStyles.js | 6 ++ .../searchModal/view/searchModalView.js | 4 +- .../searchResult/screen/searchResultScreen.js | 58 +++++++++---------- 6 files changed, 61 insertions(+), 63 deletions(-) diff --git a/src/components/posts/view/postsView.js b/src/components/posts/view/postsView.js index 52d4ba2af..fd856a5ae 100644 --- a/src/components/posts/view/postsView.js +++ b/src/components/posts/view/postsView.js @@ -93,17 +93,12 @@ class PostsView extends Component { let newPosts = []; this.setState({ isLoading: true }); - if ((!filter && tag) || filter === 'feed' || filter === 'blog' || getFor === 'blog') { + if (tag || filter === 'feed' || filter === 'blog' || getFor === 'blog') { options = { tag, limit: 3, }; - } else if (filter == 'reblogs') { - options = { - tag, - limit: 3, - }; - } else if (tag) { + } else if (filter === 'reblogs') { options = { tag, limit: 3, diff --git a/src/components/searchInput/view/searchInputStyles.js b/src/components/searchInput/view/searchInputStyles.js index 5b465ac8e..d18e9ef6e 100644 --- a/src/components/searchInput/view/searchInputStyles.js +++ b/src/components/searchInput/view/searchInputStyles.js @@ -2,6 +2,7 @@ import EStyleSheet from 'react-native-extended-stylesheet'; export default EStyleSheet.create({ inputWrapper: { + marginTop: 20, backgroundColor: '$primaryLightBackground', flexDirection: 'row', height: 44, @@ -10,9 +11,6 @@ export default EStyleSheet.create({ justifyContent: 'center', marginHorizontal: 16, }, - safeArea: { - marginTop: 20, - }, icon: { alignSelf: 'center', color: '$iconColor', diff --git a/src/components/searchInput/view/searchInputView.js b/src/components/searchInput/view/searchInputView.js index 41a448cfb..291196e3b 100644 --- a/src/components/searchInput/view/searchInputView.js +++ b/src/components/searchInput/view/searchInputView.js @@ -11,31 +11,32 @@ import styles from './searchInputStyles'; /* Props * ------------------------------------------------ - * @prop { type } name - Description.... + * @prop { func } onChangeText - The function will trigger when input on change + * @prop { func } handleOnModalClose - Handle on click method for close button + * @prop { string } placeholder - Placeholder for input + * @prop { bool } editable - Editable value for input. Default value is true. */ const SearchInputView = ({ onChangeText, handleOnModalClose, placeholder, editable = true, }) => ( - - - - onChangeText(text)} - placeholder={placeholder} - placeholderTextColor="#c1c5c7" - autoCapitalize="none" - autoFocus - editable={editable} - /> - handleOnModalClose()} - /> - + + + onChangeText(text)} + placeholder={placeholder} + placeholderTextColor="#c1c5c7" + autoCapitalize="none" + autoFocus + editable={editable} + /> + handleOnModalClose()} + /> ); diff --git a/src/components/searchModal/view/searchModalStyles.js b/src/components/searchModal/view/searchModalStyles.js index 21fd03675..94485094d 100644 --- a/src/components/searchModal/view/searchModalStyles.js +++ b/src/components/searchModal/view/searchModalStyles.js @@ -53,6 +53,12 @@ export default EStyleSheet.create({ flexDirection: 'row', alignItems: 'center', }, + searchItemImageWrapper: { + flex: 1, + }, + searchItemTextWrapper: { + flex: 7, + }, searchItemImage: { width: 40, height: 40, diff --git a/src/components/searchModal/view/searchModalView.js b/src/components/searchModal/view/searchModalView.js index e819a86b4..1a4772a5d 100644 --- a/src/components/searchModal/view/searchModalView.js +++ b/src/components/searchModal/view/searchModalView.js @@ -59,7 +59,7 @@ class SearchModalView extends PureComponent { renderItem={({ item }) => ( handleOnPressListItem(searchResults.type, item)}> - + {item.image && ( )} - + {item.text && {item.text}} diff --git a/src/screens/searchResult/screen/searchResultScreen.js b/src/screens/searchResult/screen/searchResultScreen.js index 61c4a1e7e..ada66d14e 100644 --- a/src/screens/searchResult/screen/searchResultScreen.js +++ b/src/screens/searchResult/screen/searchResultScreen.js @@ -22,34 +22,33 @@ class SearchResultScreen extends PureComponent { const { intl, tag, navigationGoBack } = this.props; return ( - - - console.log('text :', text)} - handleOnModalClose={navigationGoBack} - placeholder={tag} - editable={false} - /> - ( - - )} + + {}} + handleOnModalClose={navigationGoBack} + placeholder={tag} + editable={false} + /> + ( + + )} + > + - - - - {/* + + {/* */} - - - + + ); } }