From 941d8a50110690b5a65ea05000ec623496a002ef Mon Sep 17 00:00:00 2001 From: Mustafa Buyukcelebi Date: Mon, 25 Feb 2019 12:05:20 +0300 Subject: [PATCH] Fixed search input component --- .../searchInput/view/searchInputView.js | 12 ++++--- .../searchModal/view/searchModalView.js | 31 ++++--------------- .../container/searchResultContainer.js | 14 ++++++++- .../searchResult/screen/searchResultScreen.js | 9 ++++-- 4 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/components/searchInput/view/searchInputView.js b/src/components/searchInput/view/searchInputView.js index bcd7499f3..41a448cfb 100644 --- a/src/components/searchInput/view/searchInputView.js +++ b/src/components/searchInput/view/searchInputView.js @@ -13,25 +13,27 @@ import styles from './searchInputStyles'; * ------------------------------------------------ * @prop { type } name - Description.... */ - -const SearchInputView = () => ( +const SearchInputView = ({ + onChangeText, handleOnModalClose, placeholder, editable = true, +}) => ( console.log('text :', text)} - placeholder="tst" + onChangeText={text => onChangeText(text)} + placeholder={placeholder} placeholderTextColor="#c1c5c7" autoCapitalize="none" autoFocus + editable={editable} /> console.log('test :')} + onPress={() => handleOnModalClose()} /> diff --git a/src/components/searchModal/view/searchModalView.js b/src/components/searchModal/view/searchModalView.js index f34b8234a..e819a86b4 100644 --- a/src/components/searchModal/view/searchModalView.js +++ b/src/components/searchModal/view/searchModalView.js @@ -1,16 +1,13 @@ import React, { PureComponent } from 'react'; import { - View, Text, FlatList, TouchableHighlight, SafeAreaView, + View, Text, FlatList, TouchableHighlight, } from 'react-native'; import FastImage from 'react-native-fast-image'; // Constants // Components -import { Icon } from '../../icon'; -import { IconButton } from '../../iconButton'; import { Modal } from '../..'; -import { TextInput } from '../../textInput'; import SearchInput from '../../searchInput'; // Styles @@ -50,27 +47,11 @@ class SearchModalView extends PureComponent { isTransparent > - - - - handleOnChangeSearchInput(text)} - placeholder={placeholder} - placeholderTextColor="#c1c5c7" - autoCapitalize="none" - autoFocus - /> - handleOnClose()} - /> - - - + { + const { navigation } = this.props; + + navigation.goBack(); + }; + render() { const { currentAccount, navigation } = this.props; const tag = navigation.getParam('tag', 'esteem'); - return ; + return ( + + ); } } diff --git a/src/screens/searchResult/screen/searchResultScreen.js b/src/screens/searchResult/screen/searchResultScreen.js index f6d4856b5..61c4a1e7e 100644 --- a/src/screens/searchResult/screen/searchResultScreen.js +++ b/src/screens/searchResult/screen/searchResultScreen.js @@ -19,12 +19,17 @@ class SearchResultScreen extends PureComponent { } render() { - const { intl, tag } = this.props; + const { intl, tag, navigationGoBack } = this.props; return ( - + console.log('text :', text)} + handleOnModalClose={navigationGoBack} + placeholder={tag} + editable={false} + /> (