Remove close button for search in community modal

This commit is contained in:
Furkan Kılıç 2020-12-12 23:56:31 +03:00
parent f398de90b1
commit d8d59ac6a3
5 changed files with 13 additions and 22 deletions

View File

@ -11,13 +11,11 @@ import SelectCommunityModalView from '../view/selectCommunityModalView';
import {
fetchCommunities,
fetchCommunitiesSuccess,
fetchCommunitiesFail,
fetchSubscribedCommunities,
fetchSubscribedCommunitiesSuccess,
fetchSubscribedCommunitiesFail,
} from '../../../../redux/actions/communitiesAction';
const SelectCommunityModalContainer = ({ onPressCommunity, onPressCloseForSearch }) => {
const SelectCommunityModalContainer = ({ onPressCommunity }) => {
const dispatch = useDispatch();
const [searchedCommunities, setSearchedCommunities] = useState([]);
@ -77,7 +75,6 @@ const SelectCommunityModalContainer = ({ onPressCommunity, onPressCloseForSearch
topCommunities={topCommunities}
subscribedCommunities={subscribedCommunities}
onChangeSearch={debounce(handleChangeSearch, 500)}
onPressCloseForSearch={handlePressCloseForSearch}
searchedCommunities={searchedCommunities}
showSearchedCommunities={showSearchedCommunities}
/>

View File

@ -19,12 +19,7 @@ const SelectCommunityModalView = ({
}) => {
return (
<ScrollView style={{ flex: 1 }} showsVerticalScrollIndicator={false}>
<SearchInput
handleOnModalClose={onPressCloseForSearch}
onChangeText={onChangeSearch}
placeholder="search"
autoFocus={false}
/>
<SearchInput onChangeText={onChangeSearch} placeholder="search" autoFocus={false} />
{showSearchedCommunities ? (
<FlatList
ItemSeparatorComponent={() => <Separator />}

View File

@ -8,7 +8,7 @@ export default EStyleSheet.create({
height: 44,
borderRadius: 8,
padding: 5,
justifyContent: 'center',
justifyContent: 'flex-start',
marginHorizontal: 16,
},
icon: {

View File

@ -34,6 +34,7 @@ const SearchInputView = ({
autoFocus={autoFocus}
editable={editable}
/>
{handleOnModalClose && (
<IconButton
iconStyle={styles.closeIcon}
iconType="Ionicons"
@ -41,6 +42,7 @@ const SearchInputView = ({
name="ios-close-circle-outline"
onPress={() => handleOnModalClose()}
/>
)}
</SafeAreaView>
);

View File

@ -280,10 +280,7 @@ class EditorScreen extends Component {
presentationStyle="pageSheet"
style={styles.modal}
>
<SelectCommunityModalContainer
onPressCommunity={this._handlePressCommunity}
onPressCloseForSearch={() => this.setState({ isCommunitiesListModalOpen: false })}
/>
<SelectCommunityModalContainer onPressCommunity={this._handlePressCommunity} />
</Modal>
<BasicHeader
handleDatePickerChange={(date) => handleDatePickerChange(date, fields)}