This commit is contained in:
qt-coder 2021-06-29 11:34:23 +08:00
parent 7e434806e0
commit b538eb5065

View file

@ -22,9 +22,11 @@ import {
ChevronRightIcon, ChevronRightIcon,
} from '@chakra-ui/icons'; } from '@chakra-ui/icons';
import AuthButton from '../AuthButton' import AuthButton from '../AuthButton'
import { signIn, signOut, useSession } from 'next-auth/client';
export default function WithSubnavigation() { export default function WithSubnavigation() {
const { isOpen, onToggle } = useDisclosure(); const { isOpen, onToggle } = useDisclosure();
const [session, loading] = useSession()
return ( return (
<Box> <Box>
@ -69,14 +71,13 @@ export default function WithSubnavigation() {
justify={'flex-end'} justify={'flex-end'}
direction={'row'} direction={'row'}
spacing={6}> spacing={6}>
<AuthButton/>
<Button <Button
as={'a'} as={'a'}
fontSize={'sm'} fontSize={'sm'}
fontWeight={400} fontWeight={400}
variant={'link'} variant={'link'}
href={'https://github.com/night0721/cath.gq'}> onClick={session ? ()=>{signOut()} : ()=>{signIn()}}>
Github {session ? 'Sign Out' : 'Sign In'}
</Button> </Button>
</Stack> </Stack>
</Flex> </Flex>