1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 04:46:40 +07:00

fixed types

This commit is contained in:
muerwre 2019-08-09 14:31:09 +07:00
parent 5d219b3196
commit d9a56255c5
4 changed files with 30 additions and 13 deletions

View file

@ -15,7 +15,9 @@ interface IProps {
onDrop: DragEventHandler<HTMLFormElement>;
}
const SortableItem = SortableElement(({ children }) => <div className={styles.item}>{children}</div>);
const SortableItem = SortableElement(({ children }) => (
<div className={styles.item}>{children}</div>
));
const SortableList = SortableContainer(
({
@ -23,10 +25,10 @@ const SortableList = SortableContainer(
locked,
onDrop
}: {
items: IFile[];
locked: IUploadStatus[];
onUpload: ChangeEventHandler<HTMLInputElement>;
onDrop: DragEventHandler<HTMLFormElement>;
items: IFile[];
locked: IUploadStatus[];
onUpload: ChangeEventHandler<HTMLInputElement>;
onDrop: DragEventHandler<HTMLFormElement>;
}) => (
<form className={styles.grid} onDrop={onDrop}>
{items.map((file, index) => (
@ -46,7 +48,9 @@ const SortableList = SortableContainer(
const ImageGrid: FC<IProps> = ({
items, locked, onFileMove, onUpload, onDrop
}) => {
const onMove = useCallback(({ oldIndex, newIndex }) => onFileMove(oldIndex, newIndex), [onFileMove]);
const onMove = useCallback(({ oldIndex, newIndex }) => onFileMove(oldIndex, newIndex), [
onFileMove
]);
return (
<SortableList
@ -57,6 +61,7 @@ const ImageGrid: FC<IProps> = ({
onUpload={onUpload}
onDrop={onDrop}
pressDelay={100}
helperClass={styles.helper}
/>
);
};