about summary refs log tree commit diff
path: root/app/javascript/mastodon/features/explore/index.js
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2022-10-04 20:13:23 +0200
committerGitHub <noreply@github.com>2022-10-04 20:13:23 +0200
commite2b561e3a521ff893943c0e9e32952e35934ca54 (patch)
tree0cd2710017743e4b5ed82afde3dcad0a9c675b5c /app/javascript/mastodon/features/explore/index.js
parent6580ac724145d7c5e0af8f9ac27c69e412ffc2f8 (diff)
Fix logged-out web UI on smaller screens (#19263)
Diffstat (limited to 'app/javascript/mastodon/features/explore/index.js')
-rw-r--r--app/javascript/mastodon/features/explore/index.js29
1 files changed, 14 insertions, 15 deletions
diff --git a/app/javascript/mastodon/features/explore/index.js b/app/javascript/mastodon/features/explore/index.js
index e1d1eb563..21bb6e828 100644
--- a/app/javascript/mastodon/features/explore/index.js
+++ b/app/javascript/mastodon/features/explore/index.js
@@ -30,13 +30,13 @@ class Explore extends React.PureComponent {
 
   static contextTypes = {
     router: PropTypes.object,
+    identity: PropTypes.object,
   };
 
   static propTypes = {
     intl: PropTypes.object.isRequired,
     multiColumn: PropTypes.bool,
     isSearching: PropTypes.bool,
-    layout: PropTypes.string,
   };
 
   handleHeaderClick = () => {
@@ -48,22 +48,21 @@ class Explore extends React.PureComponent {
   }
 
   render () {
-    const { intl, multiColumn, isSearching, layout } = this.props;
+    const { intl, multiColumn, isSearching } = this.props;
+    const { signedIn } = this.context.identity;
 
     return (
       <Column bindToDocument={!multiColumn} ref={this.setRef} label={intl.formatMessage(messages.title)}>
-        {layout === 'mobile' ? (
-          <div className='explore__search-header'>
-            <Search />
-          </div>
-        ) : (
-          <ColumnHeader
-            icon={isSearching ? 'search' : 'hashtag'}
-            title={intl.formatMessage(isSearching ? messages.searchResults : messages.title)}
-            onClick={this.handleHeaderClick}
-            multiColumn={multiColumn}
-          />
-        )}
+        <ColumnHeader
+          icon={isSearching ? 'search' : 'hashtag'}
+          title={intl.formatMessage(isSearching ? messages.searchResults : messages.title)}
+          onClick={this.handleHeaderClick}
+          multiColumn={multiColumn}
+        />
+
+        <div className='explore__search-header'>
+          <Search />
+        </div>
 
         <div className='scrollable scrollable--flex'>
           {isSearching ? (
@@ -74,7 +73,7 @@ class Explore extends React.PureComponent {
                 <NavLink exact to='/explore'><FormattedMessage id='explore.trending_statuses' defaultMessage='Posts' /></NavLink>
                 <NavLink exact to='/explore/tags'><FormattedMessage id='explore.trending_tags' defaultMessage='Hashtags' /></NavLink>
                 <NavLink exact to='/explore/links'><FormattedMessage id='explore.trending_links' defaultMessage='News' /></NavLink>
-                <NavLink exact to='/explore/suggestions'><FormattedMessage id='explore.suggested_follows' defaultMessage='For you' /></NavLink>
+                {signedIn && <NavLink exact to='/explore/suggestions'><FormattedMessage id='explore.suggested_follows' defaultMessage='For you' /></NavLink>}
               </div>
 
               <Switch>