2023-11-02 23:46:07 +03:00
|
|
|
import React from 'react'
|
|
|
|
import Link from '@docusaurus/Link'
|
|
|
|
import './SocialAuthGrid.css'
|
2023-08-11 17:47:49 +03:00
|
|
|
|
|
|
|
export function SocialAuthGrid({
|
2023-11-02 23:46:07 +03:00
|
|
|
pagePart = '', // e.g. #overrides
|
2023-08-11 17:47:49 +03:00
|
|
|
}) {
|
|
|
|
const authMethods = [
|
|
|
|
{
|
2023-11-02 23:46:07 +03:00
|
|
|
title: 'Google',
|
|
|
|
description: 'Users sign in with their Google account.',
|
|
|
|
linkToDocs: '/docs/auth/social-auth/google' + pagePart,
|
2023-08-11 17:47:49 +03:00
|
|
|
},
|
|
|
|
{
|
2023-11-02 23:46:07 +03:00
|
|
|
title: 'Github',
|
|
|
|
description: 'Users sign in with their Github account.',
|
|
|
|
linkToDocs: '/docs/auth/social-auth/github' + pagePart,
|
2023-08-11 17:47:49 +03:00
|
|
|
},
|
2023-11-02 23:46:07 +03:00
|
|
|
]
|
2023-08-11 17:47:49 +03:00
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<div className="social-auth-grid">
|
|
|
|
{authMethods.map((authMethod) => (
|
|
|
|
<AuthMethodBox
|
|
|
|
title={authMethod.title}
|
|
|
|
description={authMethod.description}
|
|
|
|
linkToDocs={authMethod.linkToDocs}
|
|
|
|
/>
|
|
|
|
))}
|
|
|
|
</div>
|
|
|
|
<p className="social-auth-info">
|
|
|
|
<small>Click on each provider for more details.</small>
|
|
|
|
</p>
|
|
|
|
</>
|
2023-11-02 23:46:07 +03:00
|
|
|
)
|
2023-08-11 17:47:49 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function AuthMethodBox({
|
|
|
|
linkToDocs,
|
|
|
|
title,
|
|
|
|
description,
|
|
|
|
}: {
|
2023-11-02 23:46:07 +03:00
|
|
|
linkToDocs: string
|
|
|
|
title: string
|
|
|
|
description: string
|
2023-08-11 17:47:49 +03:00
|
|
|
}) {
|
|
|
|
return (
|
|
|
|
<Link to={linkToDocs} className="auth-method-box">
|
|
|
|
<h3>{title} »</h3>
|
|
|
|
<p>{description}</p>
|
|
|
|
</Link>
|
2023-11-02 23:46:07 +03:00
|
|
|
)
|
2023-08-11 17:47:49 +03:00
|
|
|
}
|