Merge branch 'develop' of https://github.com/processing/p5.js-web-editor into feature/mobile-save-sketch

This commit is contained in:
ghalestrilo 2020-08-18 17:24:57 -03:00
commit 5f24a71cdf
3 changed files with 26 additions and 7 deletions

View file

@ -3,6 +3,7 @@ import React from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { browserHistory } from 'react-router';
import { withTranslation } from 'react-i18next';
import get from 'lodash/get';
import { Helmet } from 'react-helmet';
import { verifyEmailConfirmation } from '../actions';
@ -31,20 +32,20 @@ class EmailVerificationView extends React.Component {
if (this.verificationToken() == null) {
status = (
<p>That link is invalid.</p>
<p>{this.props.t('EmailVerificationView.InvalidTokenNull')}</p>
);
} else if (emailVerificationTokenState === 'checking') {
status = (
<p>Validating token, please wait...</p>
<p>{this.props.t('EmailVerificationView.Checking')}</p>
);
} else if (emailVerificationTokenState === 'verified') {
status = (
<p>All done, your email address has been verified.</p>
<p>{this.props.t('EmailVerificationView.Verified')}</p>
);
setTimeout(() => browserHistory.push('/'), 1000);
} else if (emailVerificationTokenState === 'invalid') {
status = (
<p>Something went wrong.</p>
<p>{this.props.t('EmailVerificationView.InvalidState')}</p>
);
}
@ -53,10 +54,10 @@ class EmailVerificationView extends React.Component {
<Nav layout="dashboard" />
<div className="form-container">
<Helmet>
<title>p5.js Web Editor | Email Verification</title>
<title>{this.props.t('EmailVerificationView.Title')}</title>
</Helmet>
<div className="form-container__content">
<h2 className="form-container__title">Verify your email</h2>
<h2 className="form-container__title">{this.props.t('EmailVerificationView.Verify')}</h2>
{status}
</div>
</div>
@ -83,6 +84,7 @@ EmailVerificationView.propTypes = {
'checking', 'verified', 'invalid'
]),
verifyEmailConfirmation: PropTypes.func.isRequired,
t: PropTypes.func.isRequired
};
export default connect(mapStateToProps, mapDispatchToProps)(EmailVerificationView);
export default withTranslation()(connect(mapStateToProps, mapDispatchToProps)(EmailVerificationView));

View file

@ -307,5 +307,14 @@
"Or": "Or",
"AlreadyHave": "Already have an account?",
"Login": "Log In"
},
"EmailVerificationView": {
"Title": "p5.js Web Editor | Email Verification",
"Verify": "Verify your email",
"InvalidTokenNull": "That link is invalid.",
"Checking": "Validating token, please wait...",
"Verified": "All done, your email address has been verified.",
"InvalidState": "Something went wrong."
}
}

View file

@ -307,5 +307,13 @@
"Or": "o",
"AlreadyHave": "¿Ya tienes cuenta? ",
"Login": "Ingresa"
},
"EmailVerificationView": {
"Title": "Editor Web p5.js | Correo de Verificación",
"Verify": "Verica tu correo",
"InvalidTokenNull": "La liga es inválida.",
"Checking": "Validando token, por favor espera...",
"Verified": "Concluido, tu correo electrónico ha sido verificado.",
"InvalidState": "Algo salió mal."
}
}