|
@@ -7,16 +7,18 @@ import React, {
|
|
|
import Dropzone from 'react-dropzone';
|
|
import Dropzone from 'react-dropzone';
|
|
|
import { useTranslation } from 'react-i18next';
|
|
import { useTranslation } from 'react-i18next';
|
|
|
import {
|
|
import {
|
|
|
- Modal, ModalHeader, ModalBody,
|
|
|
|
|
|
|
+ Modal, ModalHeader, ModalBody, Button,
|
|
|
} from 'reactstrap';
|
|
} from 'reactstrap';
|
|
|
|
|
|
|
|
import { toastError, toastSuccess } from '~/client/util/toastr';
|
|
import { toastError, toastSuccess } from '~/client/util/toastr';
|
|
|
import { IEditorSettings } from '~/interfaces/editor-settings';
|
|
import { IEditorSettings } from '~/interfaces/editor-settings';
|
|
|
import { useDefaultIndentSize } from '~/stores/context';
|
|
import { useDefaultIndentSize } from '~/stores/context';
|
|
|
import { useEditorSettings } from '~/stores/editor';
|
|
import { useEditorSettings } from '~/stores/editor';
|
|
|
|
|
+import { useParentPageSelectModal } from '~/stores/modal';
|
|
|
import { useIsMobile } from '~/stores/ui';
|
|
import { useIsMobile } from '~/stores/ui';
|
|
|
|
|
|
|
|
import { IEditorMethods } from '../../interfaces/editor-methods';
|
|
import { IEditorMethods } from '../../interfaces/editor-methods';
|
|
|
|
|
+import { ParentPageSelectModal } from '../ParentPageSelectModal';
|
|
|
|
|
|
|
|
import AbstractEditor from './AbstractEditor';
|
|
import AbstractEditor from './AbstractEditor';
|
|
|
import { Cheatsheet } from './Cheatsheet';
|
|
import { Cheatsheet } from './Cheatsheet';
|
|
@@ -24,6 +26,7 @@ import CodeMirrorEditor from './CodeMirrorEditor';
|
|
|
import pasteHelper from './PasteHelper';
|
|
import pasteHelper from './PasteHelper';
|
|
|
import TextAreaEditor from './TextAreaEditor';
|
|
import TextAreaEditor from './TextAreaEditor';
|
|
|
|
|
|
|
|
|
|
+
|
|
|
import styles from './Editor.module.scss';
|
|
import styles from './Editor.module.scss';
|
|
|
|
|
|
|
|
export type EditorPropsType = {
|
|
export type EditorPropsType = {
|
|
@@ -66,6 +69,9 @@ const Editor: ForwardRefRenderFunction<IEditorMethods, EditorPropsType> = (props
|
|
|
const { data: editorSettings } = useEditorSettings();
|
|
const { data: editorSettings } = useEditorSettings();
|
|
|
const { data: defaultIndentSize } = useDefaultIndentSize();
|
|
const { data: defaultIndentSize } = useDefaultIndentSize();
|
|
|
const { data: isMobile } = useIsMobile();
|
|
const { data: isMobile } = useIsMobile();
|
|
|
|
|
+ const {
|
|
|
|
|
+ open: openModal,
|
|
|
|
|
+ } = useParentPageSelectModal();
|
|
|
|
|
|
|
|
const dropzoneRef = useRef<DropzoneRef>(null);
|
|
const dropzoneRef = useRef<DropzoneRef>(null);
|
|
|
// CodeMirrorEditor ref
|
|
// CodeMirrorEditor ref
|
|
@@ -335,6 +341,9 @@ const Editor: ForwardRefRenderFunction<IEditorMethods, EditorPropsType> = (props
|
|
|
}}
|
|
}}
|
|
|
</Dropzone>
|
|
</Dropzone>
|
|
|
|
|
|
|
|
|
|
+ <Button onClick={() => openModal()}>起動!</Button>
|
|
|
|
|
+ <ParentPageSelectModal></ParentPageSelectModal>
|
|
|
|
|
+
|
|
|
{ isUploadable
|
|
{ isUploadable
|
|
|
&& (
|
|
&& (
|
|
|
<button
|
|
<button
|