diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2022-10-29 13:32:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-29 13:32:49 +0200 |
commit | 55af04b253435ae771b69c8b7cfe3fc7e3b18033 (patch) | |
tree | 1802c8dd18b51e47952422150aad476f31ccce2a /app/javascript/mastodon/features/compose/components/search.js | |
parent | e6d415bb1f76a9ead4bb759c71e8c4efaeea7801 (diff) |
Fix logged out search and changed logged-in search placeholder (#19514)
Diffstat (limited to 'app/javascript/mastodon/features/compose/components/search.js')
-rw-r--r-- | app/javascript/mastodon/features/compose/components/search.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/javascript/mastodon/features/compose/components/search.js b/app/javascript/mastodon/features/compose/components/search.js index 3e36a922b..ebb23d92f 100644 --- a/app/javascript/mastodon/features/compose/components/search.js +++ b/app/javascript/mastodon/features/compose/components/search.js @@ -9,6 +9,7 @@ import Icon from 'mastodon/components/icon'; const messages = defineMessages({ placeholder: { id: 'search.placeholder', defaultMessage: 'Search' }, + placeholderSignedIn: { id: 'search.search_or_paste', defaultMessage: 'Search or paste URL' }, }); class SearchPopout extends React.PureComponent { @@ -49,6 +50,7 @@ class Search extends React.PureComponent { static contextTypes = { router: PropTypes.object.isRequired, + identity: PropTypes.object.isRequired, }; static propTypes = { @@ -116,6 +118,7 @@ class Search extends React.PureComponent { render () { const { intl, value, submitted } = this.props; const { expanded } = this.state; + const { signedIn } = this.context.identity; const hasValue = value.length > 0 || submitted; return ( @@ -126,7 +129,7 @@ class Search extends React.PureComponent { ref={this.setRef} className='search__input' type='text' - placeholder={intl.formatMessage(messages.placeholder)} + placeholder={intl.formatMessage(signedIn ? messages.placeholderSignedIn : messages.placeholder)} value={value} onChange={this.handleChange} onKeyUp={this.handleKeyUp} |