Last item in search results displays with no buffer below (#794)

This commit is contained in:
enahum
2017-07-27 18:33:20 -04:00
committed by Harrison Healey
parent 64f036982e
commit 8e0d1f56d9

View File

@@ -223,7 +223,7 @@ class Search extends Component {
actions.removeSearchTerms(currentTeamId, item.terms);
};
renderPost = ({item}) => {
renderPost = ({item, index}) => {
if (item.id === SEARCHING) {
return (
<View style={{width: '100%', height: '100%'}}>
@@ -232,7 +232,7 @@ class Search extends Component {
);
}
const {channels, theme} = this.props;
const {channels, posts, theme} = this.props;
const style = getStyleFromTheme(theme);
const channel = channels.find((c) => c.id === item.channel_id);
@@ -242,6 +242,11 @@ class Search extends Component {
displayName = channel.display_name;
}
let separator;
if (index === posts.length - 1) {
separator = this.renderPostSeparator();
}
return (
<View>
<Text style={style.channelName}>
@@ -259,6 +264,7 @@ class Search extends Component {
shouldRenderReplyButton={true}
navigator={this.props.navigator}
/>
{separator}
</View>
);
};