kosei-n 2 лет назад
Родитель
Сommit
50dc21fda8

+ 30 - 80
apps/app/src/components/Sidebar/PageCreateButton/DropendMenu.tsx

@@ -24,88 +24,38 @@ export const DropendMenu = React.memo((props: DropendMenuProps): JSX.Element =>
   const { t } = useTranslation('commons');
 
   return (
-    <>
-      {/* <ul className="dropdown-menu">
-        <li>
-          <button
-            className="dropdown-item"
-            onClick={onClickCreateNewPageButtonHandler}
-            type="button"
-          >
-            {t('create_page_dropdown.new_page')}
-          </button>
-        </li>
-        {todaysPath != null && (
-          <>
-            <li><hr className="dropdown-divider" /></li>
-            <li><span className="text-muted px-3">{t('create_page_dropdown.todays.desc')}</span></li>
-            <li>
-              <button
-                className="dropdown-item"
-                onClick={onClickCreateTodaysButtonHandler}
-                type="button"
-              >
-                {todaysPath}
-              </button>
-            </li>
-          </>
-        )}
-        <li><hr className="dropdown-divider" /></li>
-        <li><span className="text-muted text-nowrap px-3">{t('create_page_dropdown.template.desc')}</span></li>
-        <li>
-          <button
-            className="dropdown-item"
-            onClick={() => onClickTemplateButtonHandler('_template')}
-            type="button"
-          >
-            {t('create_page_dropdown.template.children')}
-          </button>
-        </li>
-        <li>
-          <button
-            className="dropdown-item"
-            onClick={() => onClickTemplateButtonHandler('__template')}
-            type="button"
+    <DropdownMenu
+      container="body"
+    >
+      <DropdownItem
+        onClick={onClickCreateNewPageButtonHandler}
+      >
+        {t('create_page_dropdown.new_page')}
+      </DropdownItem>
+      {todaysPath != null && (
+        <>
+          <DropdownItem divider />
+          <li><span className="text-muted px-3">{t('create_page_dropdown.todays.desc')}</span></li>
+          <DropdownItem
+            onClick={onClickCreateTodaysButtonHandler}
           >
-            {t('create_page_dropdown.template.descendants')}
-          </button>
-        </li>
-      </ul> */}
-
-      <DropdownMenu
-        container="body"
-        style={{ zIndex: 1055 }}
+            {todaysPath}
+          </DropdownItem>
+        </>
+      )}
+      <DropdownItem divider />
+      <li><span className="text-muted text-nowrap px-3">{t('create_page_dropdown.template.desc')}</span></li>
+      <DropdownItem
+        onClick={() => onClickTemplateButtonHandler('_template')}
+      >
+        {t('create_page_dropdown.template.children')}
+      </DropdownItem>
+      <DropdownItem
+        onClick={() => onClickTemplateButtonHandler('__template')}
       >
-        <DropdownItem
-          onClick={onClickCreateNewPageButtonHandler}
-        >
-          {t('create_page_dropdown.new_page')}
-        </DropdownItem>
-        {todaysPath != null && (
-          <>
-            <DropdownItem divider />
-            <li><span className="text-muted px-3">{t('create_page_dropdown.todays.desc')}</span></li>
-            <DropdownItem
-              onClick={onClickCreateTodaysButtonHandler}
-            >
-              {todaysPath}
-            </DropdownItem>
-          </>
-        )}
-        <DropdownItem divider />
-        <li><span className="text-muted text-nowrap px-3">{t('create_page_dropdown.template.desc')}</span></li>
-        <DropdownItem
-          onClick={() => onClickTemplateButtonHandler('_template')}
-        >
-          {t('create_page_dropdown.template.children')}
-        </DropdownItem>
-        <DropdownItem
-          onClick={() => onClickTemplateButtonHandler('__template')}
-        >
-          {t('create_page_dropdown.template.descendants')}
-        </DropdownItem>
-      </DropdownMenu>
-    </>
+        {t('create_page_dropdown.template.descendants')}
+      </DropdownItem>
+    </DropdownMenu>
   );
 });
 DropendMenu.displayName = 'DropendMenu';

+ 1 - 12
apps/app/src/components/Sidebar/PageCreateButton/DropendToggle.tsx

@@ -1,6 +1,6 @@
 import type { ButtonHTMLAttributes, DetailedHTMLProps } from 'react';
 
-import { Dropdown, DropdownToggle } from 'reactstrap';
+import { DropdownToggle } from 'reactstrap';
 
 import { Hexagon } from './Hexagon';
 
@@ -22,16 +22,5 @@ export const DropendToggle = (props: Props): JSX.Element => {
       <div className="hitarea position-absolute" />
       <span className="icon material-symbols-outlined position-absolute">chevron_right</span>
     </DropdownToggle>
-    // <DropdownToggle>
-    //   <button
-    //     type="button"
-    //     {...props}
-    //     className={`${moduleClass} btn btn-primary ${props.className ?? ''}`}
-    //   >
-    //     <Hexagon />
-    //     <div className="hitarea position-absolute" />
-    //     <span className="icon material-symbols-outlined position-absolute">chevron_right</span>
-    //   </button>
-    // </DropdownToggle>
   );
 };

+ 0 - 13
apps/app/src/components/Sidebar/PageCreateButton/PageCreateButton.tsx

@@ -97,19 +97,6 @@ export const PageCreateButton = React.memo((): JSX.Element => {
           todaysPath={todaysPath}
         />
       </Dropdown>
-      {/* <div className="btn-group dropend position-absolute">
-        <DropendToggle
-          className="dropdown-toggle dropdown-toggle-split"
-          data-bs-toggle="dropdown"
-          aria-expanded="false"
-        />
-        <DropendMenu
-          onClickCreateNewPageButtonHandler={onClickNewButton}
-          onClickCreateTodaysButtonHandler={onClickTodaysButton}
-          onClickTemplateButtonHandler={onClickTemplateButtonHandler}
-          todaysPath={todaysPath}
-        />
-      </div> */}
     </div>
   );
 });