From 2ac4f36587b8b217dcfd53e67c650c8ad27c75df Mon Sep 17 00:00:00 2001 From: Andrei Stanciu Date: Thu, 2 Feb 2017 13:31:26 +0200 Subject: Remove redundant mobile web search hint popover (#5233) --- webapp/components/rhs_thread.jsx | 2 +- webapp/components/search_bar.jsx | 41 +++++++++++++++++++++++++++------------- 2 files changed, 29 insertions(+), 14 deletions(-) (limited to 'webapp') diff --git a/webapp/components/rhs_thread.jsx b/webapp/components/rhs_thread.jsx index 950e1406b..21e4ed919 100644 --- a/webapp/components/rhs_thread.jsx +++ b/webapp/components/rhs_thread.jsx @@ -335,7 +335,7 @@ export default class RhsThread extends React.Component { var currentId = UserStore.getCurrentId(); var searchForm; if (currentId != null) { - searchForm = ; + searchForm = ; } let profile; diff --git a/webapp/components/search_bar.jsx b/webapp/components/search_bar.jsx index c5fcd4697..1ba58ea4c 100644 --- a/webapp/components/search_bar.jsx +++ b/webapp/components/search_bar.jsx @@ -37,6 +37,7 @@ export default class SearchBar extends React.Component { const state = this.getSearchTermStateFromStores(); state.focused = false; + state.isPristine = true; this.state = state; this.suggestionProviders = [new SearchChannelProvider(), new SearchUserProvider()]; @@ -114,7 +115,10 @@ export default class SearchBar extends React.Component { performSearch(terms, isMentionSearch) { if (terms.length) { - this.setState({isSearching: true}); + this.setState({ + isSearching: true, + isPristine: false + }); performSearch( terms, @@ -160,6 +164,25 @@ export default class SearchBar extends React.Component { } } + renderHintPopover(helpClass) { + if (!this.props.isCommentsPage && Utils.isMobile() && this.state.isPristine) { + return false; + } + + return ( + + + + ); + } + render() { const flagIcon = Constants.FLAG_ICON_SVG; var isSearching = null; @@ -279,16 +302,7 @@ export default class SearchBar extends React.Component { type='search' /> {isSearching} - - - + {this.renderHintPopover(helpClass)} {mentionBtn} @@ -303,5 +317,6 @@ SearchBar.defaultProps = { }; SearchBar.propTypes = { - showMentionFlagBtns: React.PropTypes.bool -}; \ No newline at end of file + showMentionFlagBtns: React.PropTypes.bool, + isCommentsPage: React.PropTypes.bool +}; -- cgit v1.2.3-1-g7c22