Skip to content

Commit

Permalink
Merge pull request #16 from the-collab-lab/elit_amaka_sign_in
Browse files Browse the repository at this point in the history
implement auth
  • Loading branch information
llyorshch authored Feb 4, 2024
2 parents e3177b2 + 56e5884 commit 07ff6af
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/views/Layout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Outlet } from 'react-router-dom';

import './Layout.css';
import { auth } from '../api/config.js';
import { SignInButton, SignOutButton, useAuth } from '../api/useAuth.jsx';

/**
* TODO: The links defined in this file don't work!
Expand All @@ -12,11 +13,15 @@ import { auth } from '../api/config.js';
*/

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

return (
<>
<div className="Layout">
<header className="Layout-header">
<h1>Smart shopping list</h1>
<p>{user?.displayName ? `Welcome ${user?.displayName}` : null}</p>
{!!user ? <SignOutButton /> : <SignInButton />}
</header>
<main className="Layout-main">
<Outlet />
Expand Down

0 comments on commit 07ff6af

Please sign in to comment.