Skip to content

Instantly share code, notes, and snippets.

@igorasilveira
Created February 19, 2022 09:45
Show Gist options
  • Save igorasilveira/c47baecf1a621ff966e2dd699f708dfe to your computer and use it in GitHub Desktop.
Save igorasilveira/c47baecf1a621ff966e2dd699f708dfe to your computer and use it in GitHub Desktop.
Navbar.js
export default function Navbar() {
const { user } = useUser();
return (
<nav className={styles.nav}>
<Link href="/">Navbar</Link>
<div>
{user ? (
<div>
<a style={{ marginRight: 8 }} href="/profile">
Profile
</a>
<button>
<a href="/api/auth/logout">Logout</a>
</button>
</div>
) : (
<button>
<a href="/api/auth/login">Login</a>
</button>
)}
</div>
</nav>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment