mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
#58 fixed upload buttons
This commit is contained in:
parent
b871cc2042
commit
97958a358b
4 changed files with 14 additions and 18 deletions
|
@ -2,23 +2,26 @@ import React, { createElement, FC, useMemo } from 'react';
|
|||
import { IDialogProps } from '~/redux/modal/constants';
|
||||
import { useCloseOnEscape } from '~/utils/hooks';
|
||||
import styles from './styles.module.scss';
|
||||
import { EMPTY_NODE, NODE_EDITORS } from '~/redux/node/constants';
|
||||
import { NODE_EDITORS } from '~/redux/node/constants';
|
||||
import { BetterScrollDialog } from '../BetterScrollDialog';
|
||||
import { CoverBackdrop } from '~/components/containers/CoverBackdrop';
|
||||
import { has, prop } from 'ramda';
|
||||
import { prop } from 'ramda';
|
||||
import { useNodeFormFormik } from '~/utils/hooks/useNodeFormFormik';
|
||||
import { EditorButtons } from '~/components/editors/EditorButtons';
|
||||
import { FileUploaderProvider, useFileUploader } from '~/utils/hooks/fileUploader';
|
||||
import { UPLOAD_SUBJECTS, UPLOAD_TARGETS } from '~/redux/uploads/constants';
|
||||
import { FormikProvider } from 'formik';
|
||||
import { useShallowSelect } from '~/utils/hooks/useShallowSelect';
|
||||
import { selectNodeEditor } from '~/redux/node/selectors';
|
||||
|
||||
interface Props extends IDialogProps {
|
||||
type: string;
|
||||
}
|
||||
|
||||
const EditorDialog: FC<Props> = ({ type, onRequestClose }) => {
|
||||
const editor = useShallowSelect(selectNodeEditor);
|
||||
const uploader = useFileUploader(UPLOAD_SUBJECTS.EDITOR, UPLOAD_TARGETS.NODES, []);
|
||||
const formik = useNodeFormFormik({ ...EMPTY_NODE, type }, uploader, onRequestClose);
|
||||
const formik = useNodeFormFormik({ ...editor, type }, uploader, onRequestClose);
|
||||
const { values, handleSubmit } = formik;
|
||||
|
||||
useCloseOnEscape(onRequestClose);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue