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'}
|
2021-07-05 15:35:09 +02:00
|
|
|
bg={'teal.400'}
|
2021-06-27 12:44:22 +02:00
|
|
|
href={'#'}
|
|
|
|
_hover={{
|
2021-07-05 15:35:09 +02:00
|
|
|
bg: 'teal.300',
|
2021-06-27 12:44:22 +02:00
|
|
|
}}
|
|
|
|
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'}
|
2021-07-05 15:35:09 +02:00
|
|
|
bg={'teal.400'}
|
2021-06-27 12:44:22 +02:00
|
|
|
href={'#'}
|
|
|
|
_hover={{
|
2021-07-05 15:35:09 +02:00
|
|
|
bg: 'teal.300',
|
2021-06-27 12:44:22 +02:00
|
|
|
}}
|
|
|
|
onClick={() => signOut()}>
|
|
|
|
Sign Out
|
|
|
|
</Button>
|
2021-06-21 12:23:41 +02:00
|
|
|
</>}
|
|
|
|
</>
|
|
|
|
}
|