diff --git a/src/App.js b/src/App.js index 3dd43f5..1582bf7 100644 --- a/src/App.js +++ b/src/App.js @@ -4,6 +4,7 @@ import Login from "./components/Login"; import About from "./components/About"; import Signup from "./components/Signup"; import Error from "./components/Error"; +import Profile from "./components/Profile" import ForgotPswd from "./components/ResetPassword" import { BrowserRouter as Router, Route, Switch, Redirect } from 'react-router-dom'; @@ -20,6 +21,7 @@ function App() { + diff --git a/src/components/Profile.js b/src/components/Profile.js new file mode 100644 index 0000000..75b4ce4 --- /dev/null +++ b/src/components/Profile.js @@ -0,0 +1,61 @@ +import React from "react"; +import Header from "../components/Header"; +import { useHistory } from "react-router-dom"; +import { useAuth } from "../auth/Auth"; + +const Profile = () => { + const { currentUser, logout } = useAuth(); + const history = useHistory(); + + async function handleLogout() { + try { + await logout(); + history.push("/"); + } catch (error) { + alert(error); + } + } + + return ( +
+
+
+
+
+
+ Profile Picture +
+
+
+

+ {currentUser.displayName} +

+ + + + + + + +
Email{currentUser.email}
+ {/*
+ +
*/} +
+
+
+
+
+ ); +}; + +export default Profile;