Skip to content

Commit

Permalink
Added signin/signout button dependent on auth
Browse files Browse the repository at this point in the history
  • Loading branch information
tannaurus committed Aug 11, 2024
1 parent d9831b7 commit 8c5495d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/views/Layout.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Outlet } from 'react-router-dom';
import { useAuth, SignInButton, SignOutButton } from '../api/useAuth';

import './Layout.css';

Expand All @@ -11,6 +12,8 @@ import './Layout.css';
*/

export function Layout() {
let { user } = useAuth();

return (
<>
<div className="Layout">
Expand All @@ -21,6 +24,7 @@ export function Layout() {
<Outlet />
</main>
<nav className="Nav">
{!!user ? <SignOutButton /> : <SignInButton />}
<div className="Nav-container">
<button href="#" className="Nav-link">
Home
Expand Down

0 comments on commit 8c5495d

Please sign in to comment.