mirror of
https://github.com/rjNemo/ticket_manager
synced 2026-06-12 11:46:40 +00:00
created navbar component
This commit is contained in:
parent
8036853803
commit
723cb94ed5
1 changed files with 16 additions and 0 deletions
16
client/src/components/Navbar.tsx
Normal file
16
client/src/components/Navbar.tsx
Normal 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>
|
||||||
|
);
|
||||||
|
};
|
||||||
Loading…
Reference in a new issue