Remove redundant mobile web search hint popover (#5233)
Этот коммит содержится в:
коммит произвёл
George Goldberg
родитель
7563a8635c
Коммит
2ac4f36587
@@ -335,7 +335,7 @@ export default class RhsThread extends React.Component {
|
|||||||
var currentId = UserStore.getCurrentId();
|
var currentId = UserStore.getCurrentId();
|
||||||
var searchForm;
|
var searchForm;
|
||||||
if (currentId != null) {
|
if (currentId != null) {
|
||||||
searchForm = <SearchBox/>;
|
searchForm = <SearchBox isCommentsPage='true'/>;
|
||||||
}
|
}
|
||||||
|
|
||||||
let profile;
|
let profile;
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ export default class SearchBar extends React.Component {
|
|||||||
|
|
||||||
const state = this.getSearchTermStateFromStores();
|
const state = this.getSearchTermStateFromStores();
|
||||||
state.focused = false;
|
state.focused = false;
|
||||||
|
state.isPristine = true;
|
||||||
this.state = state;
|
this.state = state;
|
||||||
|
|
||||||
this.suggestionProviders = [new SearchChannelProvider(), new SearchUserProvider()];
|
this.suggestionProviders = [new SearchChannelProvider(), new SearchUserProvider()];
|
||||||
@@ -114,7 +115,10 @@ export default class SearchBar extends React.Component {
|
|||||||
|
|
||||||
performSearch(terms, isMentionSearch) {
|
performSearch(terms, isMentionSearch) {
|
||||||
if (terms.length) {
|
if (terms.length) {
|
||||||
this.setState({isSearching: true});
|
this.setState({
|
||||||
|
isSearching: true,
|
||||||
|
isPristine: false
|
||||||
|
});
|
||||||
|
|
||||||
performSearch(
|
performSearch(
|
||||||
terms,
|
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 (
|
||||||
|
<Popover
|
||||||
|
id='searchbar-help-popup'
|
||||||
|
placement='bottom'
|
||||||
|
className={helpClass}
|
||||||
|
>
|
||||||
|
<FormattedHTMLMessage
|
||||||
|
id='search_bar.usage'
|
||||||
|
defaultMessage='<h4>Search Options</h4><ul><li><span>Use </span><b>"quotation marks"</b><span> to search for phrases</span></li><li><span>Use </span><b>from:</b><span> to find posts from specific users and </span><b>in:</b><span> to find posts in specific channels</span></li></ul>'
|
||||||
|
/>
|
||||||
|
</Popover>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const flagIcon = Constants.FLAG_ICON_SVG;
|
const flagIcon = Constants.FLAG_ICON_SVG;
|
||||||
var isSearching = null;
|
var isSearching = null;
|
||||||
@@ -279,16 +302,7 @@ export default class SearchBar extends React.Component {
|
|||||||
type='search'
|
type='search'
|
||||||
/>
|
/>
|
||||||
{isSearching}
|
{isSearching}
|
||||||
<Popover
|
{this.renderHintPopover(helpClass)}
|
||||||
id='searchbar-help-popup'
|
|
||||||
placement='bottom'
|
|
||||||
className={helpClass}
|
|
||||||
>
|
|
||||||
<FormattedHTMLMessage
|
|
||||||
id='search_bar.usage'
|
|
||||||
defaultMessage='<h4>Search Options</h4><ul><li><span>Use </span><b>"quotation marks"</b><span> to search for phrases</span></li><li><span>Use </span><b>from:</b><span> to find posts from specific users and </span><b>in:</b><span> to find posts in specific channels</span></li></ul>'
|
|
||||||
/>
|
|
||||||
</Popover>
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
{mentionBtn}
|
{mentionBtn}
|
||||||
@@ -303,5 +317,6 @@ SearchBar.defaultProps = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
SearchBar.propTypes = {
|
SearchBar.propTypes = {
|
||||||
showMentionFlagBtns: React.PropTypes.bool
|
showMentionFlagBtns: React.PropTypes.bool,
|
||||||
};
|
isCommentsPage: React.PropTypes.bool
|
||||||
|
};
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user