2021-11-16 22:52:23 +01:00
|
|
|
import { signIn, signOut, useSession } from "next-auth/client";
|
|
|
|
import { Button } from "@chakra-ui/react";
|
2021-06-21 12:23:41 +02:00
|
|
|
|
|
|
|
export default function Page() {
|
2021-11-16 22:52:23 +01:00
|
|
|
const [session, loading] = useSession();
|
2021-06-21 12:23:41 +02:00
|
|
|
|
2021-11-16 22:52:23 +01:00
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{!session && (
|
|
|
|
<>
|
|
|
|
<Button
|
|
|
|
display={{ base: "none", md: "inline-flex" }}
|
|
|
|
fontSize={"sm"}
|
|
|
|
fontWeight={600}
|
|
|
|
color={"white"}
|
|
|
|
bg={"teal.400"}
|
|
|
|
href={"#"}
|
|
|
|
_hover={{
|
|
|
|
bg: "teal.300",
|
|
|
|
}}
|
|
|
|
onClick={() => signIn()}
|
|
|
|
>
|
|
|
|
Sign In
|
|
|
|
</Button>
|
|
|
|
</>
|
|
|
|
)}
|
|
|
|
{session && (
|
|
|
|
<>
|
|
|
|
<Button
|
|
|
|
display={{ base: "none", md: "inline-flex" }}
|
|
|
|
fontSize={"sm"}
|
|
|
|
fontWeight={600}
|
|
|
|
color={"white"}
|
|
|
|
bg={"teal.400"}
|
|
|
|
href={"#"}
|
|
|
|
_hover={{
|
|
|
|
bg: "teal.300",
|
|
|
|
}}
|
|
|
|
onClick={() => signOut()}
|
|
|
|
>
|
|
|
|
Sign Out
|
|
|
|
</Button>
|
|
|
|
</>
|
|
|
|
)}
|
2021-06-21 12:23:41 +02:00
|
|
|
</>
|
2021-11-16 22:52:23 +01:00
|
|
|
);
|
|
|
|
}
|