Add GitHub provider

This commit is contained in:
Cédric FAMIBELLE-PRONZOLA
2022-10-28 08:28:35 +04:00
parent 4e79513eca
commit 10a12ea8f5
4 changed files with 17 additions and 2 deletions
+6
View File
@@ -43,6 +43,12 @@ const PROVIDERS = [
title: 'Twitter',
width: 56,
height: 46
},
{
id: 'github',
title: 'GitHub',
width: 52,
height: 51
}
]
+4 -1
View File
@@ -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>