import React from 'react'; import PropTypes from 'prop-types'; import { createSubscribedElement } from './UnstatedUtils'; import AppContainer from '../services/AppContainer'; import SearchTypeahead from './SearchTypeahead'; // SearchTypeahead wrapper class SearchForm extends React.Component { constructor(props) { super(props); this.state = { searchError: null, }; this.onSearchError = this.onSearchError.bind(this); this.onChange = this.onChange.bind(this); } componentDidMount() { } componentWillUnmount() { } onSearchError(err) { this.setState({ searchError: err, }); } onChange(selected) { const page = selected[0]; // should be single page selected // navigate to page if (page != null) { window.location = page.path; } } getHelpElement() { const { t, appContainer } = this.props; const config = appContainer.getConfig(); const isReachable = config.isSearchServiceReachable; if (!isReachable) { return ( <>
word1 word2({ t('search_help.and.syntax help') }) |
{ t('search_help.and.desc', { word1: 'word1', word2: 'word2' }) } |
|---|---|
"This is GROWI"({ t('search_help.phrase.syntax help') }) |
{ t('search_help.phrase.desc', { phrase: 'This is GROWI' }) } |
-keyword |
{ t('search_help.exclude.desc', { word: 'keyword' }) } |
prefix:/user/ |
{ t('search_help.prefix.desc', { path: '/user/' }) } |
-prefix:/user/ |
{ t('search_help.exclude_prefix.desc', { path: '/user/' }) } |
tag:wiki |
{ t('search_help.tag.desc', { tag: 'wiki' }) } |
-tag:wiki |
{ t('search_help.exclude_tag.desc', { tag: 'wiki' }) } |