- complete onyx design template

- implement public sharable urls
- implement more actions
This commit is contained in:
Amruth Pillai
2020-07-11 20:42:16 +05:30
parent 0b5653fab5
commit 5ec1f21bd3
55 changed files with 1025 additions and 412 deletions

View File

@ -20,6 +20,10 @@ const StorageProvider = ({ children }) => {
const dispatch = useDispatch();
const uploadPhotograph = async (file) => {
if (!file) {
return null;
}
if (!isFileImage(file)) {
toast.error(
"You tried to upload a file that was not an image. That won't look good on your resume. Please try again.",
@ -27,6 +31,13 @@ const StorageProvider = ({ children }) => {
return null;
}
if (file.size > 2097152) {
toast.error(
"Your image seems to be bigger than 2 MB. That's way too much. Maybe consider reducing it's size?",
);
return null;
}
const uploadTask = firebase
.storage()
.ref(`/users/${user.uid}/photographs/${id}`)