about summary refs log tree commit diff
path: root/app/javascript/mastodon/features/ui/components/compose_panel.js
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2022-09-29 04:39:33 +0200
committerGitHub <noreply@github.com>2022-09-29 04:39:33 +0200
commit43b5d5e38d2b8ad8f1d1ad0911c3c1718159c912 (patch)
treeedfad4e2db222aeba66c8c9e0d27f6a327ac9b98 /app/javascript/mastodon/features/ui/components/compose_panel.js
parent1a5150e9c364635b989cd0983dac259f94dbbea9 (diff)
Add logged-out access to the web UI (#18961)
Diffstat (limited to 'app/javascript/mastodon/features/ui/components/compose_panel.js')
-rw-r--r--app/javascript/mastodon/features/ui/components/compose_panel.js22
1 files changed, 20 insertions, 2 deletions
diff --git a/app/javascript/mastodon/features/ui/components/compose_panel.js b/app/javascript/mastodon/features/ui/components/compose_panel.js
index 3d0c48c7a..1c128188f 100644
--- a/app/javascript/mastodon/features/ui/components/compose_panel.js
+++ b/app/javascript/mastodon/features/ui/components/compose_panel.js
@@ -10,6 +10,10 @@ import { changeComposing } from 'mastodon/actions/compose';
 export default @connect()
 class ComposePanel extends React.PureComponent {
 
+  static contextTypes = {
+    identity: PropTypes.object.isRequired,
+  };
+
   static propTypes = {
     dispatch: PropTypes.func.isRequired,
   };
@@ -23,11 +27,25 @@ class ComposePanel extends React.PureComponent {
   }
 
   render() {
+    const { signedIn } = this.context.identity;
+
     return (
       <div className='compose-panel' onFocus={this.onFocus}>
         <SearchContainer openInRoute />
-        <NavigationContainer onClose={this.onBlur} />
-        <ComposeFormContainer singleColumn />
+
+        {!signedIn && (
+          <React.Fragment>
+            <div className='flex-spacer' />
+          </React.Fragment>
+        )}
+
+        {signedIn && (
+          <React.Fragment>
+            <NavigationContainer onClose={this.onBlur} />
+            <ComposeFormContainer singleColumn />
+          </React.Fragment>
+        )}
+
         <LinkFooter withHotkeys />
       </div>
     );