Просмотр исходного кода

78782 SearchResutlContentSubNavigation component

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

+ 0 - 4
packages/app/src/components/Navbar/GrowiSubNavigation.jsx

@@ -64,10 +64,6 @@ const GrowiSubNavigation = (props) => {
         ) }
 
         <div className="grw-path-nav-container">
-          {/* TODO : display tags when this component is used in SearchResultContent too.
-              For that, refactor TagLabels such that it can be used while not depending on pageContainer
-              TASK: #80623 https://estoc.weseek.co.jp/redmine/issues/80623
-          */}
           { isAbleToShowTagLabel && !isCompactMode && !isTagLabelHidden && (
             <div className="grw-taglabels-container">
               <TagLabels editorMode={editorMode} />

+ 1 - 1
packages/app/src/components/Navbar/PagePathNav.tsx

@@ -9,7 +9,7 @@ import LinkedPagePath from '../../models/linked-page-path';
 type Props = {
   pageId :string,
   pagePath:string,
-  isEditorMode:string,
+  isEditorMode:boolean,
   isCompactMode:boolean,
 }
 

+ 3 - 3
packages/app/src/components/SearchPage/SearchResultContent.tsx

@@ -2,7 +2,7 @@ import React, { FC } from 'react';
 
 import RevisionLoader from '../Page/RevisionLoader';
 import AppContainer from '../../client/services/AppContainer';
-import GrowiSubNavigation from '../Navbar/GrowiSubNavigation';
+import SearchResultContentSubNavigation from './SearchResultContentSubNavigation';
 
 type Props ={
   appContainer: AppContainer,
@@ -15,13 +15,13 @@ const SearchResultContent: FC<Props> = (props: Props) => {
   // Temporaly workaround for lint error
   // later needs to be fixed: RevisoinRender to typescriptcomponet
   const RevisionLoaderTypeAny: any = RevisionLoader;
-  const GrowiSubNavigationTypeAny: any = GrowiSubNavigation;
+  const SearchResultContentSubNavigationTypeAny : any = SearchResultContentSubNavigation;
   const growiRenderer = props.appContainer.getRenderer('searchresult');
   let showTags = false;
   if (page.tags != null && page.tags.length > 0) { showTags = true }
   return (
     <div key={page._id} className="search-result-page mb-5">
-      <GrowiSubNavigationTypeAny isSearchPageMode pageId={page._id} path={page.path}></GrowiSubNavigationTypeAny>
+      <SearchResultContentSubNavigationTypeAny isSearchPageMode pageId={page._id} path={page.path}></SearchResultContentSubNavigationTypeAny>
       <RevisionLoaderTypeAny
         growiRenderer={growiRenderer}
         pageId={page._id}

+ 40 - 0
packages/app/src/components/SearchPage/SearchResultContentSubNavigation.tsx

@@ -0,0 +1,40 @@
+import React, { FC } from 'react';
+import PagePathNav from '../Navbar/PagePathNav';
+
+type Props = {
+  pageId: string,
+  path: string,
+  isCompactMode: boolean,
+}
+
+const SearchResultContentSubNavigation: FC<Props> = (props : Props) => {
+  const {
+    pageId, path,
+  } = props;
+  return (
+    <div className="d-flex">
+      {/* 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
+          */}
+        {/* {isAbleToShowTagLabel && !isCompactMode && !isTagLabelHidden && (
+          <div className="grw-taglabels-container">
+            <TagLabels editorMode={editorMode} />
+          </div>
+        )} */}
+        <PagePathNav pageId={pageId} pagePath={path} isCompactMode={false} isEditorMode={false} />
+      </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
+        */}
+        {/* <SubnavButtons isCompactMode={isCompactMode} /> */}
+      </div>
+    </div>
+  );
+};
+
+
+export default SearchResultContentSubNavigation;