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