diff --git a/apps/app/src/client/components/SearchForm.module.scss b/apps/app/src/client/components/SearchForm.module.scss deleted file mode 100644 index 335d5bae86d..00000000000 --- a/apps/app/src/client/components/SearchForm.module.scss +++ /dev/null @@ -1,36 +0,0 @@ -@use '@growi/core-styles/scss/bootstrap/init' as bs; - -.grw-search-table { - caption { - display: table-header-group; - } -} - -@include bs.media-breakpoint-down(sm) { - .grw-search-table { - th { - text-align: right; - } - - td { - overflow-wrap: anywhere; - white-space: normal !important; - } - - @include bs.media-breakpoint-down(xs) { - th, - td { - display: block; - } - - th { - text-align: left; - } - - td { - padding-top: 0 !important; - border-top: none !important; - } - } - } -} diff --git a/apps/app/src/client/components/SearchForm.tsx b/apps/app/src/client/components/SearchForm.tsx deleted file mode 100644 index 099cf333902..00000000000 --- a/apps/app/src/client/components/SearchForm.tsx +++ /dev/null @@ -1,143 +0,0 @@ -import React, { - FC, forwardRef, ForwardRefRenderFunction, useImperativeHandle, - useRef, useState, -} from 'react'; - -import { useTranslation } from 'next-i18next'; - -import { IFocusable } from '~/client/interfaces/focusable'; -import { TypeaheadProps } from '~/client/interfaces/react-bootstrap-typeahead'; -import { IPageWithSearchMeta } from '~/interfaces/search'; - -import SearchTypeahead from './SearchTypeahead'; - -import styles from './SearchForm.module.scss'; - - -type SearchFormHelpProps = { - isReachable: boolean, -} - -const SearchFormHelp: FC = React.memo((props: SearchFormHelpProps) => { - const { t } = useTranslation(); - - const { isReachable } = props; - - if (!isReachable) { - return ( - <> -
Error occured on Search Service
- Try to reconnect from management page. - - ); - } - - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
search{ t('search_help.title') }
-
- 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' }) }
- ); -}); - -SearchFormHelp.displayName = 'SearchFormHelp'; - - -type Props = TypeaheadProps & { - isSearchServiceReachable: boolean, - - keywordOnInit?: string, - disableIncrementalSearch?: boolean, - onChange?: (data: IPageWithSearchMeta[]) => void, - onSubmit?: (input: string) => void, -}; - - -const SearchForm: ForwardRefRenderFunction = (props: Props, ref) => { - const { t } = useTranslation(); - const { - isSearchServiceReachable, - keywordOnInit, - disableIncrementalSearch, - dropup, onChange, onBlur, onFocus, onSubmit, onInputChange, - } = props; - - const [searchError, setSearchError] = useState(null); - - const searchTyheaheadRef = useRef(null); - - // publish focus() - useImperativeHandle(ref, () => ({ - focus() { - const instance = searchTyheaheadRef?.current; - if (instance != null) { - instance.focus(); - } - }, - })); - - const placeholder = isSearchServiceReachable - ? 'Search ...' - : 'Error on Search Service'; - - const emptyLabel = (searchError != null) - ? 'Error on searching.' - : t('search.search page bodies'); - - return ( - setSearchError(err)} - onBlur={onBlur} - onFocus={onFocus} - keywordOnInit={keywordOnInit} - disableIncrementalSearch={disableIncrementalSearch} - helpElement={} - /> - ); -}; - -export default forwardRef(SearchForm);