Stub context properties and methods

This commit is contained in:
jwu-fisker
2021-01-05 12:06:23 -08:00
parent ec653ca530
commit c593b2dfc4
2 changed files with 60 additions and 0 deletions

View 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);