about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/ui/components/compose_panel.js
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2022-09-29 04:39:33 +0200
committerClaire <claire.github-309c@sitedethib.com>2022-10-09 15:29:14 +0200
commit0ff1d62c7a5f6b62799a028364b819a5b0686af1 (patch)
tree867e570c7cca9f1b239731765628d666c6a037b5 /app/javascript/flavours/glitch/features/ui/components/compose_panel.js
parent022547fbdf28351a6cf67ef281e372e9eff455b4 (diff)
[Glitch] Add logged-out access to the web UI
Port part of 43b5d5e38d2b8ad8f1d1ad0911c3c1718159c912 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/features/ui/components/compose_panel.js')
-rw-r--r--app/javascript/flavours/glitch/features/ui/components/compose_panel.js42
1 files changed, 33 insertions, 9 deletions
diff --git a/app/javascript/flavours/glitch/features/ui/components/compose_panel.js b/app/javascript/flavours/glitch/features/ui/components/compose_panel.js
index 498f09ab6..298c15a8a 100644
--- a/app/javascript/flavours/glitch/features/ui/components/compose_panel.js
+++ b/app/javascript/flavours/glitch/features/ui/components/compose_panel.js
@@ -1,16 +1,40 @@
 import React from 'react';
+import PropTypes from 'prop-types';
 import SearchContainer from 'flavours/glitch/features/compose/containers/search_container';
 import ComposeFormContainer from 'flavours/glitch/features/compose/containers/compose_form_container';
 import NavigationContainer from 'flavours/glitch/features/compose/containers/navigation_container';
 import LinkFooter from './link_footer';
 
-const ComposePanel = () => (
-  <div className='compose-panel'>
-    <SearchContainer openInRoute />
-    <NavigationContainer />
-    <ComposeFormContainer singleColumn />
-    <LinkFooter withHotkeys />
-  </div>
-);
+export default
+class ComposePanel extends React.PureComponent {
 
-export default ComposePanel;
+  static contextTypes = {
+    identity: PropTypes.object.isRequired,
+  };
+
+  render() {
+    const { signedIn } = this.context.identity;
+
+    return (
+      <div className='compose-panel'>
+        <SearchContainer openInRoute />
+
+        {!signedIn && (
+          <React.Fragment>
+            <div className='flex-spacer' />
+          </React.Fragment>
+        )}
+
+        {signedIn && (
+          <React.Fragment>
+            <NavigationContainer />
+            <ComposeFormContainer singleColumn />
+          </React.Fragment>
+        )}
+
+        <LinkFooter withHotkeys />
+      </div>
+    );
+  }
+
+};