Skip to content

Commit

Permalink
add signIn and signout functionalities
Browse files Browse the repository at this point in the history
  • Loading branch information
redapy committed Feb 4, 2024
1 parent 9798c86 commit 26e8200
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/views/Layout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,22 @@ import { SignInButton, SignOutButton, useAuth } from '../api/useAuth.jsx';

export function Layout() {
const { user } = useAuth();
console.log(user);
return (
<>
<div className="Layout">
<header className="Layout-header">
<h1>Smart shopping list</h1>
{!user ? (
<div>
<SignInButton />
</div>
) : (
<div>
<span>{user?.displayName}</span>
<SignOutButton />
</div>
)}
</header>
<main className="Layout-main">
<Outlet />
Expand Down

0 comments on commit 26e8200

Please sign in to comment.