created navbar component

This commit is contained in:
Ruidy Nemausat 2020-03-05 15:40:57 +01:00
parent 8036853803
commit 723cb94ed5

View file

@ -0,0 +1,16 @@
import React from "react";
import { useAuth0 } from "../authentication/auth0";
export const NavBar = () => {
const { isAuthenticated, loginWithRedirect, logout } = useAuth0();
return (
<div>
{!isAuthenticated && (
<button onClick={() => loginWithRedirect({})}>Log in</button>
)}
{isAuthenticated && <button onClick={() => logout()}>Log out</button>}
</div>
);
};