import React from 'react';
import PropTypes from 'prop-types';
import { Meteor } from 'meteor/meteor';
import { Bert } from 'meteor/themeteorchef:bert';
import Icon from '../Icon/Icon';
import { translate, Trans } from 'react-i18next';
import './OAuthLoginButton.scss';
const handleLogin = (service, callback) => {
const options = {
facebook: {
requestPermissions: ['email'],
loginStyle: 'popup',
},
github: {
requestPermissions: ['user:email'],
loginStyle: 'popup',
},
google: {
requestPermissions: ['email', 'profile'],
requestOfflineToken: true,
loginStyle: 'popup',
},
}[service];
return {
facebook: Meteor.loginWithFacebook,
github: Meteor.loginWithGithub,
google: Meteor.loginWithGoogle,
}[service](options, callback);
};
const serviceLabel = {
facebook: Log In with Facebook,
github: Log In with GitHub,
google: Iniciar sesión con Google,
};
const OAuthLoginButton = ({ service, callback }) => (
);
OAuthLoginButton.defaultProps = {
callback: (error) => {
if (error) Bert.alert(error.message, 'danger');
},
};
OAuthLoginButton.propTypes = {
service: PropTypes.string.isRequired,
callback: PropTypes.func,
};
export default translate([], { wait: true })(OAuthLoginButton);