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

Merge pull request #2951 from weseek/imprv/add-contents-in-dot-drop-down-other-than-delete

Imprv/add contents in dot drop down other than delete
Yuki Takei 5 лет назад
Родитель
Сommit
b1a9b3f790
1 измененных файлов с 19 добавлено и 1 удалено
  1. 19 1
      src/client/js/components/Page/PageManagement.jsx

+ 19 - 1
src/client/js/components/Page/PageManagement.jsx

@@ -100,6 +100,24 @@ const PageManagement = (props) => {
   //   setIsArchiveCreateModalShown(false);
   //   setIsArchiveCreateModalShown(false);
   // }
   // }
 
 
+  function renderDropdownItemForTopPage() {
+    return (
+      <>
+        <button className="dropdown-item" type="button" onClick={openPageDuplicateModalHandler}>
+          <i className="icon-fw icon-docs"></i> { t('Duplicate') }
+        </button>
+        {/* TODO Presentation Mode is not function. So if it is really necessary, survey this cause and implement Presentation Mode in top page */}
+        {/* <button className="dropdown-item" type="button" onClick={openPagePresentationModalHandler}>
+          <i className="icon-fw"><PresentationIcon /></i><span className="d-none d-sm-inline"> { t('Presentation Mode') }</span>
+        </button> */}
+        <button type="button" className="dropdown-item" onClick={() => { exportPageHandler('md') }}>
+          <i className="icon-fw icon-cloud-download"></i>{t('export_bulk.export_page_markdown')}
+        </button>
+        <div className="dropdown-divider"></div>
+      </>
+    );
+  }
+
   function renderDropdownItemForNotTopPage() {
   function renderDropdownItemForNotTopPage() {
     return (
     return (
       <>
       <>
@@ -206,7 +224,7 @@ const PageManagement = (props) => {
     <>
     <>
       {currentUser == null ? renderDotsIconForGuestUser() : renderDotsIconForCurrentUser()}
       {currentUser == null ? renderDotsIconForGuestUser() : renderDotsIconForCurrentUser()}
       <div className="dropdown-menu dropdown-menu-right">
       <div className="dropdown-menu dropdown-menu-right">
-        {!isTopPagePath && renderDropdownItemForNotTopPage()}
+        {isTopPagePath ? renderDropdownItemForTopPage() : renderDropdownItemForNotTopPage()}
         <button className="dropdown-item" type="button" onClick={openPageTemplateModalHandler}>
         <button className="dropdown-item" type="button" onClick={openPageTemplateModalHandler}>
           <i className="icon-fw icon-magic-wand"></i> { t('template.option_label.create/edit') }
           <i className="icon-fw icon-magic-wand"></i> { t('template.option_label.create/edit') }
         </button>
         </button>