Skip to content

Commit

Permalink
Merge pull request #18 from the-collab-lab/tg/sign-in-button
Browse files Browse the repository at this point in the history
Added signin/signout button dependent on auth
  • Loading branch information
tannaurus authored Aug 11, 2024
2 parents d9831b7 + 8c5495d commit ec86266
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 ec86266

Please sign in to comment.