2024-01-19 22:53:38 +00:00
|
|
|
import { For } from 'solid-js'
|
|
|
|
|
2024-03-07 08:07:46 +00:00
|
|
|
import { useLocalize } from '../../../../context/localize'
|
|
|
|
import { useSession } from '../../../../context/session'
|
|
|
|
import { Icon } from '../../../_shared/Icon'
|
2022-10-25 16:25:42 +00:00
|
|
|
|
|
|
|
import styles from './SocialProviders.module.scss'
|
|
|
|
|
2024-01-19 22:53:38 +00:00
|
|
|
export const PROVIDERS = ['facebook', 'google', 'github'] // 'vk' | 'telegram'
|
2022-10-25 16:25:42 +00:00
|
|
|
|
|
|
|
export const SocialProviders = () => {
|
2023-02-17 09:21:02 +00:00
|
|
|
const { t } = useLocalize()
|
2024-02-04 17:40:15 +00:00
|
|
|
const { oauth } = useSession()
|
2024-01-19 15:03:33 +00:00
|
|
|
|
2022-10-25 16:25:42 +00:00
|
|
|
return (
|
2024-01-19 18:25:18 +00:00
|
|
|
<div class={styles.container}>
|
|
|
|
<div class={styles.text}>{t('or sign in with social networks')}</div>
|
|
|
|
<div class={styles.social}>
|
2024-01-19 22:53:38 +00:00
|
|
|
<For each={PROVIDERS}>
|
|
|
|
{(provider) => (
|
2024-03-07 08:07:46 +00:00
|
|
|
<button type="button" class={styles[provider]} onClick={(_e) => oauth(provider)}>
|
2024-01-19 22:53:38 +00:00
|
|
|
<Icon name={provider} />
|
2024-02-04 09:03:15 +00:00
|
|
|
</button>
|
2024-01-19 22:53:38 +00:00
|
|
|
)}
|
|
|
|
</For>
|
2022-10-25 16:25:42 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|