mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-22 20:51:29 +10:00
- complete onyx design template
- implement public sharable urls - implement more actions
This commit is contained in:
@ -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}`)
|
||||
|
||||
Reference in New Issue
Block a user