Mao 4 лет назад
Родитель
Сommit
928cc49187

+ 1 - 3
packages/app/src/components/Navbar/SubNavButtons.jsx

@@ -9,10 +9,9 @@ import BookmarkButton from '../BookmarkButton';
 import LikeButtons from '../LikeButtons';
 import PageManagement from '../Page/PageManagement';
 
-// TODO : once PageReactionButtons and PageMangement can be used while not depending on pageContainer,  add isSearchPageMode to render condition.
 const SubnavButtons = (props) => {
   const {
-    appContainer, navigationContainer, pageContainer, isCompactMode, isSearchPageMode,
+    appContainer, navigationContainer, pageContainer, isCompactMode,
   } = props;
 
   /* eslint-enable react/prop-types */
@@ -61,7 +60,6 @@ SubnavButtons.propTypes = {
   navigationContainer: PropTypes.instanceOf(NavigationContainer).isRequired,
   pageContainer: PropTypes.instanceOf(PageContainer).isRequired,
   isCompactMode: PropTypes.bool,
-  isSearchPageMode: PropTypes.bool,
 };
 
 export default SubnavButtonsWrapper;

+ 18 - 5
packages/app/src/components/SearchPage/SearchResultContentSubNavigation.tsx

@@ -1,7 +1,10 @@
 import React, { FC } from 'react';
 import PagePathNav from '../PagePathNav';
+import { withUnstatedContainers } from '../UnstatedUtils';
+import AppContainer from '../../client/services/AppContainer';
 
 type Props = {
+  appContainer:AppContainer
   pageId: string,
   path: string,
   isEditorMode: boolean,
@@ -10,27 +13,31 @@ type Props = {
 
 const SearchResultContentSubNavigation: FC<Props> = (props : Props) => {
   const {
-    pageId, path,
+    appContainer, pageId, path, isCompactMode, isEditorMode,
   } = props;
+
+  const { isSharedUser } = appContainer;
   return (
-    <div className="d-flex">
+    <div className={`grw-subnav container-fluid d-flex align-items-center justify-content-between ${isCompactMode ? 'grw-subnav-compact d-print-none' : ''}`}>
       {/* Left side */}
       <div className="grw-path-nav-container">
         {/* TODO : refactor TagLabels in a way that it can be used independently from pageContainenr
               TASK: #80623 https://estoc.weseek.co.jp/redmine/issues/80623
               CONDITION reference : https://dev.growi.org/5fabddf8bbeb1a0048bcb9e9
+              userPage is not included in search so chekcing only isSharedUser or not.
           */}
-        {/* {isAbleToShowTagLabel && !isCompactMode && !isTagLabelHidden && (
+        {/* { !isSharedUser &&  !isCompactMode &&  (
           <div className="grw-taglabels-container">
             <TagLabels editorMode={editorMode} />
           </div>
         )} */}
-        <PagePathNav pageId={pageId} pagePath={path} isCompactMode={false} isEditorMode={false} />
+        <PagePathNav pageId={pageId} pagePath={path} isCompactMode={isCompactMode} isEditorMode={isEditorMode} />
       </div>
       {/* Right side */}
       <div className="d-flex">
         {/* TODO: refactor SubNavButtons in a way that it can be used independently from pageContainer
               TASK : #80481 https://estoc.weseek.co.jp/redmine/issues/80481
+              CONDITION reference: https://dev.growi.org/5fabddf8bbeb1a0048bcb9e9
         */}
         {/* <SubnavButtons isCompactMode={isCompactMode} /> */}
       </div>
@@ -39,4 +46,10 @@ const SearchResultContentSubNavigation: FC<Props> = (props : Props) => {
 };
 
 
-export default SearchResultContentSubNavigation;
+/**
+ * Wrapper component for using unstated
+ */
+const SearchResultContentSubNavigationWrapper = withUnstatedContainers(SearchResultContentSubNavigation, [AppContainer]);
+
+
+export default SearchResultContentSubNavigationWrapper;