itizawa 5 лет назад
Родитель
Сommit
a9fc530ff4

+ 3 - 2
src/client/js/components/Sidebar.jsx

@@ -146,7 +146,6 @@ class Sidebar extends React.Component {
 
   renderSidebarContents = () => {
     const scrollTargetSelector = 'div[data-testid="ContextualNavigation"] div[role="group"]';
-
     return (
       <>
         <StickyStretchableScroller
@@ -156,7 +155,9 @@ class Sidebar extends React.Component {
           calcViewHeightFunc={this.calcViewHeight}
         />
         <div id="grw-sidebar-content-container" className="grw-sidebar-content-container">
-          <SidebarContents />
+          <SidebarContents
+            isSharedUser={this.props.appContainer.isSharedUser}
+          />
         </div>
       </>
     );

+ 10 - 1
src/client/js/components/Sidebar/SidebarContents.jsx

@@ -10,8 +10,11 @@ import RecentChanges from './RecentChanges';
 import CustomSidebar from './CustomSidebar';
 
 const SidebarContents = (props) => {
+  const { navigationContainer, isSharedUser } = props;
 
-  const { navigationContainer } = props;
+  if (isSharedUser) {
+    return null;
+  }
 
   let Contents;
   switch (navigationContainer.state.sidebarContentsId) {
@@ -30,6 +33,12 @@ const SidebarContents = (props) => {
 
 SidebarContents.propTypes = {
   navigationContainer: PropTypes.instanceOf(NavigationContainer).isRequired,
+
+  isSharedUser: PropTypes.bool,
+};
+
+SidebarContents.defaultProps = {
+  isSharedUser: false,
 };
 
 /**

+ 1 - 1
src/client/js/services/NavigationContainer.js

@@ -27,7 +27,7 @@ export default class NavigationContainer extends Container {
       isDrawerMode: null,
       isDrawerOpened: false,
 
-      sidebarContentsId: this.appContainer.isSharedUser ? 'custom' : 'recent',
+      sidebarContentsId: 'recent',
 
       isScrollTop: true,