More i18n work
This commit is contained in:
parent
3ef6f3c80b
commit
2ad4972115
16 changed files with 286 additions and 90 deletions
|
|
@ -3,6 +3,7 @@ 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';
|
||||
|
||||
|
|
@ -31,9 +32,9 @@ const handleLogin = (service, callback) => {
|
|||
};
|
||||
|
||||
const serviceLabel = {
|
||||
facebook: <span><Icon icon="facebook-official" /> Log In with Facebook</span>,
|
||||
github: <span><Icon icon="github" /> Log In with GitHub</span>,
|
||||
google: <span><Icon icon="google" /> Log In with Google</span>,
|
||||
facebook: <span><Icon icon="facebook-official" /> <Trans parent="span">Log In with Facebook</Trans></span>,
|
||||
github: <span><Icon icon="github" /> <Trans parent="span">Log In with GitHub</Trans></span>,
|
||||
google: <span><Icon icon="google" /> <Trans parent="span">Iniciar sesión con Google</Trans></span>,
|
||||
};
|
||||
|
||||
const OAuthLoginButton = ({ service, callback }) => (
|
||||
|
|
@ -57,4 +58,4 @@ OAuthLoginButton.propTypes = {
|
|||
callback: PropTypes.func,
|
||||
};
|
||||
|
||||
export default OAuthLoginButton;
|
||||
export default translate([], { wait: true })(OAuthLoginButton);
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
background: #fff;
|
||||
padding: 0 10px;
|
||||
position: absolute;
|
||||
bottom: -19px;
|
||||
bottom: -27px;
|
||||
left: 50%;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
34
imports/ui/components/ReSendEmail/ReSendEmail.js
Normal file
34
imports/ui/components/ReSendEmail/ReSendEmail.js
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Grid, Alert, Button } from 'react-bootstrap';
|
||||
import { t, Trans, translate, Interpolate } from 'react-i18next';
|
||||
|
||||
const handleResendVerificationEmail = (emailAddress, t) => {
|
||||
Meteor.call('users.sendVerificationEmail', (error) => {
|
||||
if (error) {
|
||||
Bert.alert(error.reason, 'danger');
|
||||
} else {
|
||||
Bert.alert(t("checkVerificationEmail", {email: emailAddress}), 'success');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const ReSendEmail = props => (
|
||||
<div>
|
||||
{props.userId && !props.emailVerified ? <Alert className="verify-email text-center"><p><Interpolate i18nKey="verifyEmail" email={props.emailAddress}></Interpolate> <Button bsStyle="link" onClick={() => handleResendVerificationEmail(props.emailAddress, props.t)} href="#"><Trans parent="span">Reenviar email de verificación</Trans></Button></p></Alert> : ''}
|
||||
</div>
|
||||
);
|
||||
|
||||
ReSendEmail.defaultProps = {
|
||||
userId: '',
|
||||
emailAddress: '',
|
||||
};
|
||||
|
||||
ReSendEmail.propTypes = {
|
||||
loading: PropTypes.bool.isRequired,
|
||||
userId: PropTypes.string,
|
||||
emailAddress: PropTypes.string,
|
||||
emailVerified: PropTypes.bool.isRequired,
|
||||
};
|
||||
|
||||
export default translate([], { wait: true })(ReSendEmail);
|
||||
Loading…
Add table
Add a link
Reference in a new issue