Created
March 7, 2023 11:36
-
-
Save ByteCrak07/354b61e37304c70fb8965dbe1817a8c1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Head from "next/head"; | |
import { NextPage } from "next"; | |
import Link from "next/link"; | |
import { usePbAuth } from "../contexts/AuthWrapper"; | |
const Home: NextPage = () => { | |
const { user, signOut } = usePbAuth(); | |
return ( | |
<> | |
<Head> | |
<title>Home page</title> | |
</Head> | |
<main> | |
{!user ? ( | |
<Link href="/signin">Sign In page</Link> | |
) : ( | |
<> | |
<h1>{user.name}</h1> | |
<p> | |
<img src={user.avatarUrl} width={50} alt="avatar" /> | |
</p> | |
<p>Username: {user.username}</p> | |
<p>Email: {user.email}</p> | |
<button onClick={signOut}>Sign Out</button> | |
</> | |
)} | |
</main> | |
</> | |
); | |
}; | |
export default Home; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment