Add GitHub provider
This commit is contained in:
@@ -43,6 +43,12 @@ const PROVIDERS = [
|
||||
title: 'Twitter',
|
||||
width: 56,
|
||||
height: 46
|
||||
},
|
||||
{
|
||||
id: 'github',
|
||||
title: 'GitHub',
|
||||
width: 52,
|
||||
height: 51
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
@@ -2,8 +2,11 @@ import PropTypes from 'prop-types'
|
||||
import Link from 'next/link'
|
||||
import Image from 'next/image'
|
||||
import {signIn} from 'next-auth/react'
|
||||
import {useTheme} from '@mui/material/styles'
|
||||
|
||||
export default function LoginProvider({id, title, width, height, callbackUrl}) {
|
||||
const theme = useTheme()
|
||||
|
||||
const hanleClick = event => {
|
||||
event.preventDefault()
|
||||
signIn(id, {
|
||||
@@ -18,7 +21,7 @@ export default function LoginProvider({id, title, width, height, callbackUrl}) {
|
||||
width={width}
|
||||
height={height}
|
||||
alt={title}
|
||||
src={`/images/${id}.svg`}
|
||||
src={`/images/${id === 'github' ? `${id}-${theme.palette.mode}` : id}.svg`}
|
||||
onClick={hanleClick}
|
||||
/>
|
||||
</Link>
|
||||
|
||||
Reference in New Issue
Block a user