- implement about section

This commit is contained in:
Amruth Pillai
2020-07-14 22:59:59 +05:30
parent af955bbf55
commit b7c565de79
20 changed files with 441 additions and 112 deletions

View File

@ -17,6 +17,7 @@ const defaultState = {
user: defaultUser,
logout: async () => {},
loginWithGoogle: async () => {},
loginAnonymously: async () => {},
deleteAccount: async () => {},
};
@ -57,6 +58,14 @@ const UserProvider = ({ children }) => {
}
};
const loginAnonymously = async () => {
try {
return await firebase.auth().signInAnonymously();
} catch (error) {
toast.error(error.message);
}
};
const logout = () => {
firebase.auth().signOut();
localStorage.removeItem('user');
@ -87,6 +96,7 @@ const UserProvider = ({ children }) => {
logout,
loading,
loginWithGoogle,
loginAnonymously,
deleteAccount,
}}
>