diff --git a/client/src/components/App/index.jsx b/client/src/components/App/index.jsx index c2b6e60..c42e9a1 100644 --- a/client/src/components/App/index.jsx +++ b/client/src/components/App/index.jsx @@ -1,6 +1,5 @@ import React from "react"; import { BrowserRouter as Router } from "react-router-dom"; - import MainNavbar from "../MainNavbar"; import MainRouter from "../Router"; diff --git a/client/src/components/MainNavbar/index.jsx b/client/src/components/MainNavbar/index.jsx index 1aca51e..80fb46e 100644 --- a/client/src/components/MainNavbar/index.jsx +++ b/client/src/components/MainNavbar/index.jsx @@ -19,29 +19,17 @@ export default function MainNavbar() { return ( - App + + LandingPage + diff --git a/client/src/index.js b/client/src/index.js index 42dde5d..655575d 100644 --- a/client/src/index.js +++ b/client/src/index.js @@ -1,15 +1,18 @@ import React from "react"; -import ReactDOM from "react-dom"; +import { render } from "react-dom"; import { Provider } from "react-redux"; import "bootstrap/dist/css/bootstrap.min.css"; import store from "./store"; +import Firebase, { FirebaseContext } from "./services/auth"; import * as serviceWorker from "./serviceWorker"; import App from "./components/App"; -ReactDOM.render( +render( - + + + , document.getElementById("root") diff --git a/client/src/services/auth/firebase.js b/client/src/services/auth/firebase.js index 7deb498..eb6be31 100644 --- a/client/src/services/auth/firebase.js +++ b/client/src/services/auth/firebase.js @@ -21,4 +21,22 @@ export default class Firebase { app.initializeApp(CONFIG); this.auth = app.auth(); } + + provider = new app.auth.GoogleAuthProvider(); + signInWithGoogle = () => + this.auth + .signInWithPopup(this.provider) + .then((res) => console.log(res.user)); + + createUserWithEmailAndPassword = (email, password) => + this.auth.createUserWithEmailAndPassword(email, password); + + signinWithEmailAndPassword = (email, password) => + this.auth.signInWithEmailAndPassword(email, password); + + signOut = () => this.auth.signOut(); + + resetPassword = (email) => this.auth.sendPasswordResetEmail(email); + + updatePassword = (password) => this.auth.currentUser.updatePassword(password); }