Stub context properties and methods
This commit is contained in:
25
src/components/contexts/FileUploadContext.jsx
Normal file
25
src/components/contexts/FileUploadContext.jsx
Normal file
@@ -0,0 +1,25 @@
|
||||
import React, { useContext, useEffect, useState } from 'react';
|
||||
|
||||
const FileUploadContext = React.createContext();
|
||||
|
||||
export const FileUploadProvider = ({ children }) => {
|
||||
const [file, setFile] = useState(null);
|
||||
const [uploading, setUploading] = useState(false);
|
||||
const [progress, setProgress] = useState(0);
|
||||
|
||||
const upload = (file) => {
|
||||
|
||||
};
|
||||
|
||||
return (
|
||||
<FileUploadContext.Provider value={{
|
||||
uploading,
|
||||
progress,
|
||||
upload,
|
||||
}}>
|
||||
{children}
|
||||
</FileUploadContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
export const useFileUploadContext = () => useContext(FileUploadContext);
|
||||
Reference in New Issue
Block a user