wasp/web/docs/auth/social-auth/SocialAuthGrid.tsx

59 lines
1.3 KiB
TypeScript
Raw Normal View History

2023-11-02 23:46:07 +03:00
import React from 'react'
import Link from '@docusaurus/Link'
import './SocialAuthGrid.css'
export function SocialAuthGrid({
2023-11-02 23:46:07 +03:00
pagePart = '', // e.g. #overrides
}) {
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-11-02 23:46:07 +03:00
title: 'Github',
description: 'Users sign in with their Github account.',
linkToDocs: '/docs/auth/social-auth/github' + pagePart,
},
2024-03-18 15:09:08 +03:00
{
title: 'Keycloak',
description: 'Users sign in with their Keycloak account.',
linkToDocs: '/docs/auth/social-auth/keycloak' + pagePart,
},
2023-11-02 23:46:07 +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
)
}
function AuthMethodBox({
linkToDocs,
title,
description,
}: {
2023-11-02 23:46:07 +03:00
linkToDocs: string
title: string
description: string
}) {
return (
<Link to={linkToDocs} className="auth-method-box">
<h3>{title} »</h3>
<p>{description}</p>
</Link>
2023-11-02 23:46:07 +03:00
)
}