about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2022-10-29 13:32:49 +0200
committerClaire <claire.github-309c@sitedethib.com>2022-10-30 18:24:57 +0100
commiteb307ec1bdb0acd1f90ebf338b9664a9c5b49f80 (patch)
tree3240e3ca23b113c427246eb9c7630e9ff13036a1 /app/javascript/flavours/glitch/features
parenteee36267d627ae08898d2b3301f56ce729055e82 (diff)
[Glitch] Fix logged out search and changed logged-in search placeholder
Port 55af04b253435ae771b69c8b7cfe3fc7e3b18033 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/features')
-rw-r--r--app/javascript/flavours/glitch/features/compose/components/search.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/features/compose/components/search.js b/app/javascript/flavours/glitch/features/compose/components/search.js
index a59418e46..326fe5b70 100644
--- a/app/javascript/flavours/glitch/features/compose/components/search.js
+++ b/app/javascript/flavours/glitch/features/compose/components/search.js
@@ -21,6 +21,7 @@ import Motion from '../../ui/util/optional_motion';
 
 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 {
@@ -62,6 +63,7 @@ class Search extends React.PureComponent {
 
   static contextTypes = {
     router: PropTypes.object.isRequired,
+    identity: PropTypes.object.isRequired,
   };
 
   static propTypes = {
@@ -137,6 +139,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 (
@@ -147,7 +150,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}