|
|
@@ -1,9 +1,11 @@
|
|
|
import React from 'react';
|
|
|
|
|
|
import { useTranslation } from 'react-i18next';
|
|
|
+import { DropdownMenu, DropdownItem } from 'reactstrap';
|
|
|
|
|
|
import { LabelType } from '~/interfaces/template';
|
|
|
|
|
|
+
|
|
|
type DropendMenuProps = {
|
|
|
onClickCreateNewPageButtonHandler: () => Promise<void>
|
|
|
onClickCreateTodaysButtonHandler: () => Promise<void>
|
|
|
@@ -22,52 +24,85 @@ export const DropendMenu = React.memo((props: DropendMenuProps): JSX.Element =>
|
|
|
const { t } = useTranslation('commons');
|
|
|
|
|
|
return (
|
|
|
- <ul className="dropdown-menu">
|
|
|
- <li>
|
|
|
- <button
|
|
|
- className="dropdown-item"
|
|
|
+ <>
|
|
|
+ {/* <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"
|
|
|
+ >
|
|
|
+ {t('create_page_dropdown.template.descendants')}
|
|
|
+ </button>
|
|
|
+ </li>
|
|
|
+ </ul> */}
|
|
|
+
|
|
|
+ <DropdownMenu container="body">
|
|
|
+ <DropdownItem
|
|
|
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"
|
|
|
+ </DropdownItem>
|
|
|
+ {todaysPath != null && (
|
|
|
+ <>
|
|
|
+ <DropdownItem divider />
|
|
|
+ <li><span className="text-muted px-3">{t('create_page_dropdown.todays.desc')}</span></li>
|
|
|
+ <DropdownItem
|
|
|
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"
|
|
|
+ </DropdownItem>
|
|
|
+ </>
|
|
|
+ )}
|
|
|
+ <DropdownItem divider />
|
|
|
+ <li><span className="text-muted text-nowrap px-3">{t('create_page_dropdown.template.desc')}</span></li>
|
|
|
+ <DropdownItem
|
|
|
onClick={() => onClickTemplateButtonHandler('_template')}
|
|
|
- type="button"
|
|
|
>
|
|
|
{t('create_page_dropdown.template.children')}
|
|
|
- </button>
|
|
|
- </li>
|
|
|
- <li>
|
|
|
- <button
|
|
|
- className="dropdown-item"
|
|
|
+ </DropdownItem>
|
|
|
+ <DropdownItem
|
|
|
onClick={() => onClickTemplateButtonHandler('__template')}
|
|
|
- type="button"
|
|
|
>
|
|
|
{t('create_page_dropdown.template.descendants')}
|
|
|
- </button>
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
+ </DropdownItem>
|
|
|
+ </DropdownMenu>
|
|
|
+ </>
|
|
|
);
|
|
|
});
|
|
|
DropendMenu.displayName = 'DropendMenu';
|