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

View File

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

View File

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

View File

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

View File

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