- run eslint --fix across project

This commit is contained in:
Amruth Pillai
2020-07-09 00:14:13 +05:30
parent a1931f5e36
commit 9045e2983d
72 changed files with 1392 additions and 868 deletions

View File

@ -1,9 +1,9 @@
import firebase from "gatsby-plugin-firebase";
import React, { createContext, useContext, useRef } from "react";
import { toast } from "react-toastify";
import { isFileImage } from "../utils";
import { useDispatch, useSelector } from "./ResumeContext";
import UserContext from "./UserContext";
import firebase from 'gatsby-plugin-firebase';
import React, { createContext, useContext, useRef } from 'react';
import { toast } from 'react-toastify';
import { isFileImage } from '../utils';
import { useDispatch, useSelector } from './ResumeContext';
import UserContext from './UserContext';
const defaultState = {
uploadPhotograph: async () => {},
@ -22,7 +22,7 @@ const StorageProvider = ({ children }) => {
const uploadPhotograph = async (file) => {
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."
"You tried to upload a file that was not an image. That won't look good on your resume. Please try again.",
);
return null;
}
@ -33,16 +33,16 @@ const StorageProvider = ({ children }) => {
.put(file);
let progress = 0;
toastId.current = toast("Firing up engines...", {
toastId.current = toast('Firing up engines...', {
progress,
});
uploadTask.on(
"state_changed",
'state_changed',
(snapshot) => {
progress = (snapshot.bytesTransferred / snapshot.totalBytes) * 100;
toast.update(toastId.current, {
render: "Uploading...",
render: 'Uploading...',
progress,
hideProgressBar: false,
});
@ -51,23 +51,23 @@ const StorageProvider = ({ children }) => {
async () => {
const downloadURL = await uploadTask.snapshot.ref.getDownloadURL();
dispatch({
type: "on_input",
type: 'on_input',
payload: {
path: "profile.photograph",
path: 'profile.photograph',
value: downloadURL,
},
});
toast.update(toastId.current, {
render:
"Your photograph was uploaded successfully... and you look great!",
'Your photograph was uploaded successfully... and you look great!',
progress,
autoClose: 5000,
hideProgressBar: true,
});
toastId.current = null;
}
},
);
};