@@ -166,3 +181,98 @@ This HOCs assumes the following props are present on the wrapped component:
### withZipDownload props
*`downloadFiles: () => any`: download all the fragment's file as a zip
# Files drag and drop
## withFileSectionDrop
HOC used to provide drop functionality to the `FileSection` component. It's main purpose is to change a file from one list to another. This is usually done in a callback called `changeList` that should be provided to the wrapped component.
This HOC assumes the wrapped component has the following props:
*`files: [{id: string, ...}]`: the list of files passed to the wrapped component
*`allowedFileExtensions: [string]`: the allowed files
*`maxFiles: number`: the maximum number of files allowed
*`changeList: (fromListId: string, toListId: string: fileId: string)`: callback called if all the conditions are met (allowed files, number of files, etc)
HOC used to provide native file drop functionality to the `FileSection` component. It's purpose is to do something when dragging files from the computer's hard drive into the app. _This HOC allows only single items! Dragging multiple items into the wrapped component will only handle the first item!_
This HOC assumes the wrapped component has the following props:
*`files: [{id: string, ...}]`: the list of files passed to the wrapped component