Skip to content

Commit

Permalink
Add some information about Full-text search being disabled in search …
Browse files Browse the repository at this point in the history
…popout
  • Loading branch information
ClearlyClaire committed Sep 6, 2023
1 parent d881988 commit f2c4b3b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
28 changes: 15 additions & 13 deletions app/javascript/mastodon/features/compose/components/search.jsx
Expand Up @@ -8,7 +8,7 @@ import classNames from 'classnames';
import ImmutablePropTypes from 'react-immutable-proptypes';

import { Icon } from 'mastodon/components/icon';
import { searchEnabled } from 'mastodon/initial_state';
import { domain, searchEnabled } from 'mastodon/initial_state';
import { HASHTAG_REGEX } from 'mastodon/utils/hashtags';

const messages = defineMessages({
Expand Down Expand Up @@ -354,18 +354,20 @@ class Search extends PureComponent {
</>
)}

{searchEnabled && (
<>
<h4><FormattedMessage id='search_popout.options' defaultMessage='Search options' /></h4>

<div className='search__popout__menu'>
{this.defaultOptions.map(({ key, label, action }, i) => (
<button key={key} onMouseDown={action} className={classNames('search__popout__menu__item', { selected: selectedOption === (options.length + i) })}>
{label}
</button>
))}
</div>
</>
<h4><FormattedMessage id='search_popout.options' defaultMessage='Search options' /></h4>

{searchEnabled ? (
<div className='search__popout__menu'>
{this.defaultOptions.map(({ key, label, action }, i) => (
<button key={key} onMouseDown={action} className={classNames('search__popout__menu__item', { selected: selectedOption === (options.length + i) })}>
{label}
</button>
))}
</div>
) : (
<div className='search__popout__menu__message'>
<FormattedMessage id='search_popout.full_text_search_disabled_message' defaultMessage='Not available on {domain}.' values={{ domain }} />
</div>
)}
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions app/javascript/mastodon/locales/en.json
Expand Up @@ -590,6 +590,7 @@
"search.quick_action.open_url": "Open URL in Mastodon",
"search.quick_action.status_search": "Posts matching {x}",
"search.search_or_paste": "Search or paste URL",
"search_popout.full_text_search_disabled_message": "Not available on {domain}.",
"search_popout.language_code": "ISO language code",
"search_popout.options": "Search options",
"search_popout.quick_actions": "Quick actions",
Expand Down

0 comments on commit f2c4b3b

Please sign in to comment.