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

Merge pull request #4603 from weseek/feat/79820-80705-add-pagetree-sidebar

feat: Add PageTree sidebar
Yuki Takei 4 лет назад
Родитель
Сommit
33421c52c5

+ 1 - 0
packages/app/resource/locales/en_US/translation.json

@@ -150,6 +150,7 @@
   "No bookmarks yet": "No bookmarks yet",
   "Recent Created": "Recent Created",
   "Recent Changes": "Recent Changes",
+  "Page Tree": "Page Tree",
   "original_path":"Original path",
   "new_path":"New path",
   "duplicated_path":"duplicated_path",

+ 1 - 0
packages/app/resource/locales/ja_JP/translation.json

@@ -152,6 +152,7 @@
   "No bookmarks yet": "No bookmarks yet",
   "Recent Created": "最新の作成",
   "Recent Changes": "最新の変更",
+  "Page Tree": "ページツリー",
   "original_path":"元のパス",
   "new_path":"新しいパス",
   "duplicated_path":"重複したパス",

+ 1 - 0
packages/app/resource/locales/zh_CN/translation.json

@@ -158,6 +158,7 @@
   "No bookmarks yet": "暂无书签",
 	"Recent Created": "最新创建",
   "Recent Changes": "最新修改",
+  "Page Tree": "页面树",
   "original_path":"Original path",
   "new_path":"New path",
   "duplicated_path":"duplicated_path",

+ 24 - 0
packages/app/src/components/Sidebar/PageTree.tsx

@@ -0,0 +1,24 @@
+import React, { FC } from 'react';
+import { useTranslation } from 'react-i18next';
+
+
+type Props = {
+}
+
+const PageTree:FC<Props> = (props: Props) => {
+
+  const { t } = useTranslation();
+
+  return (
+    <>
+      <div className="grw-sidebar-content-header p-3 d-flex">
+        <h3 className="mb-0">{t('Page Tree')}</h3>
+      </div>
+      <div className="grw-sidebar-content-body p-3">
+        TBD
+      </div>
+    </>
+  );
+};
+
+export default PageTree;

+ 4 - 0
packages/app/src/components/Sidebar/SidebarContents.jsx

@@ -8,6 +8,7 @@ import NavigationContainer from '~/client/services/NavigationContainer';
 
 import RecentChanges from './RecentChanges';
 import CustomSidebar from './CustomSidebar';
+import PageTree from './PageTree';
 
 const SidebarContents = (props) => {
   const { navigationContainer, isSharedUser } = props;
@@ -21,6 +22,9 @@ const SidebarContents = (props) => {
     case 'recent':
       Contents = RecentChanges;
       break;
+    case 'tree':
+      Contents = PageTree;
+      break;
     default:
       Contents = CustomSidebar;
   }

+ 1 - 0
packages/app/src/components/Sidebar/SidebarNav.jsx

@@ -66,6 +66,7 @@ class SidebarNav extends React.Component {
         <div className="grw-sidebar-nav-primary-container">
           {!isSharedUser && <PrimaryItem id="custom" label="Custom Sidebar" iconName="code" />}
           {!isSharedUser && <PrimaryItem id="recent" label="Recent Changes" iconName="update" />}
+          {!isSharedUser && <PrimaryItem id="tree" label="Page Tree" iconName="format_list_bulleted" />}
           {/* <PrimaryItem id="tag" label="Tags" iconName="icon-tag" /> */}
           {/* <PrimaryItem id="favorite" label="Favorite" iconName="icon-star" /> */}
         </div>