1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-26 00:29:48 +02:00

Add dropzone for attachment, paste attachment from clipboard

This commit is contained in:
Maksim Eltyshev 2020-04-28 19:46:55 +05:00
parent 693602698b
commit d264382fda
24 changed files with 576 additions and 253 deletions

View file

@ -1,6 +1,7 @@
import useField from './use-field';
import useForm from './use-form';
import useSteps from './use-steps';
import useModal from './use-modal';
import useClosableForm from './use-closable-form';
export { useField, useForm, useSteps, useClosableForm };
export { useField, useForm, useSteps, useModal, useClosableForm };

View file

@ -0,0 +1,15 @@
import { useCallback, useState } from 'react';
export default (initialParams) => {
const [modal, setModal] = useState(() => initialParams);
const open = useCallback((params) => {
setModal(params);
}, []);
const handleClose = useCallback(() => {
setModal(null);
}, []);
return [modal, open, handleClose];
};

View file

@ -14,7 +14,7 @@ const createStep = (type, params = {}) => {
export default (initialType, initialParams) => {
const [step, setStep] = useState(() => createStep(initialType, initialParams));
const openStep = useCallback((type, params) => {
const open = useCallback((type, params) => {
setStep(createStep(type, params));
}, []);
@ -22,5 +22,5 @@ export default (initialType, initialParams) => {
setStep(null);
}, []);
return [step, openStep, handleBack];
return [step, open, handleBack];
};