diff --git a/public/assets/svgs/file_upload.svg b/public/assets/svgs/file_upload.svg new file mode 100644 index 000000000..f11a922ff --- /dev/null +++ b/public/assets/svgs/file_upload.svg @@ -0,0 +1 @@ +going up \ No newline at end of file diff --git a/resources/scripts/components/server/files/FileManagerContainer.tsx b/resources/scripts/components/server/files/FileManagerContainer.tsx index 520365104..1e3e29ce6 100644 --- a/resources/scripts/components/server/files/FileManagerContainer.tsx +++ b/resources/scripts/components/server/files/FileManagerContainer.tsx @@ -16,6 +16,7 @@ import useServer from '@/plugins/useServer'; import { ServerContext } from '@/state/server'; import useFileManagerSwr from '@/plugins/useFileManagerSwr'; import MassActionsBar from '@/components/server/files/MassActionsBar'; +import UploadButton from '@/components/server/files/UploadButton'; const sortFiles = (files: FileObject[]): FileObject[] => { return files.sort((a, b) => a.name.localeCompare(b.name)) @@ -79,6 +80,7 @@ export default () => { + { + const [ visible, setVisible ] = useState(false); + + const onDragOver = (e: any) => { + e.preventDefault(); + + //console.log(e); + }; + + const onDragEnter = (e: any) => { + e.preventDefault(); + + //console.log(e); + }; + + const onDragLeave = (e: any) => { + e.preventDefault(); + + //console.log(e); + }; + + const onFileDrop = (e: any) => { + e.preventDefault(); + + const files = e.dataTransfer.files; + console.log(files); + }; + + return ( + <> + { + visible ? + + + + + Drag and drop files to upload + + + + : + null + } + + setVisible(true)}> + Upload + + > + ); +};
Drag and drop files to upload