feat: draggable events

This commit is contained in:
cv
2021-05-06 12:05:21 +02:00
parent 0631dec3d3
commit 4161dd29c8
17 changed files with 408 additions and 209 deletions
+24 -11
View File
@@ -1,3 +1,5 @@
import { Draggable } from 'react-beautiful-dnd';
import { FiMoreVertical } from 'react-icons/fi';
import DeleteIconBtn from '../../../common/components/buttons/DeleteIconBtn';
import ActionButtons from './ActionButtons';
import style from './Block.module.css';
@@ -16,16 +18,27 @@ export default function BlockBlock(props) {
};
return (
<div className={style.block}>
<div className={style.actionOverlay}>
<DeleteIconBtn clickhandler={deleteHandler} />
<ActionButtons
showAdd
addHandler={addHandler}
showDelay
delayHandler={delayHandler}
/>
</div>
</div>
<Draggable key={data.id} draggableId={data.id} index={index}>
{(provided) => (
<div
className={style.block}
{...provided.draggableProps}
ref={provided.innerRef}
>
<span className={style.drag} {...provided.dragHandleProps}>
<FiMoreVertical />
</span>
<div className={style.actionOverlay}>
<DeleteIconBtn clickhandler={deleteHandler} />
<ActionButtons
showAdd
addHandler={addHandler}
showDelay
delayHandler={delayHandler}
/>
</div>
</div>
)}
</Draggable>
);
}