diff --git a/imports/ui/components/OAuthLoginButton/OAuthLoginButton.js b/imports/ui/components/OAuthLoginButton/OAuthLoginButton.js index 678eb3d..606e026 100644 --- a/imports/ui/components/OAuthLoginButton/OAuthLoginButton.js +++ b/imports/ui/components/OAuthLoginButton/OAuthLoginButton.js @@ -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: Log In with Facebook, - github: Log In with GitHub, - google: Log In with Google, + facebook: Log In with Facebook, + github: Log In with GitHub, + google: Iniciar sesión con Google, }; const OAuthLoginButton = ({ service, callback }) => ( @@ -57,4 +58,4 @@ OAuthLoginButton.propTypes = { callback: PropTypes.func, }; -export default OAuthLoginButton; +export default translate([], { wait: true })(OAuthLoginButton); diff --git a/imports/ui/components/OAuthLoginButtons/OAuthLoginButtons.scss b/imports/ui/components/OAuthLoginButtons/OAuthLoginButtons.scss index 673e347..672f8ea 100644 --- a/imports/ui/components/OAuthLoginButtons/OAuthLoginButtons.scss +++ b/imports/ui/components/OAuthLoginButtons/OAuthLoginButtons.scss @@ -13,7 +13,7 @@ background: #fff; padding: 0 10px; position: absolute; - bottom: -19px; + bottom: -27px; left: 50%; } } diff --git a/imports/ui/components/ReSendEmail/ReSendEmail.js b/imports/ui/components/ReSendEmail/ReSendEmail.js new file mode 100644 index 0000000..57d339d --- /dev/null +++ b/imports/ui/components/ReSendEmail/ReSendEmail.js @@ -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 => ( +
+ {props.userId && !props.emailVerified ?

: ''} +
+); + +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); diff --git a/imports/ui/layouts/App/App.js b/imports/ui/layouts/App/App.js index 12b1111..6134407 100644 --- a/imports/ui/layouts/App/App.js +++ b/imports/ui/layouts/App/App.js @@ -28,6 +28,7 @@ import Footer from '../../components/Footer/Footer'; import Terms from '../../pages/Terms/Terms'; import Privacy from '../../pages/Privacy/Privacy'; import License from '../../pages/License/License'; +import ReSendEmail from '../../components/ReSendEmail/ReSendEmail'; // i18n import { I18nextProvider } from 'react-i18next'; import i18n from '/imports/startup/client/i18n'; @@ -36,24 +37,12 @@ import i18n from '/imports/startup/client/i18n'; import './App.scss'; -const handleResendVerificationEmail = (emailAddress) => { - Meteor.call('users.sendVerificationEmail', (error) => { - if (error) { - Bert.alert(error.reason, 'danger'); - } else { - Bert.alert(`Check ${emailAddress} for a verification link!`, 'success'); - } - }); -}; - - - const App = props => ( {!props.loading ?
- {props.userId && !props.emailVerified ?

Hey friend! Can you verify your email address ({props.emailAddress}) for us?

: ''} + {/* bsClass="previously-container-but-disabled" > */} diff --git a/imports/ui/pages/Index/Index-custom.scss b/imports/ui/pages/Index/Index-custom.scss index 20afd6b..26f65fc 100644 --- a/imports/ui/pages/Index/Index-custom.scss +++ b/imports/ui/pages/Index/Index-custom.scss @@ -1,3 +1,5 @@ +@import '../../stylesheets/colors'; + .carousel-item { height: 65vh; min-height: 300px; @@ -134,5 +136,6 @@ } .participe-btn { - background-color: #FD593A + background-color: $todos-palette1; + color: white; } diff --git a/imports/ui/pages/Login/Login.js b/imports/ui/pages/Login/Login.js index 52ae22d..cddb43a 100644 --- a/imports/ui/pages/Login/Login.js +++ b/imports/ui/pages/Login/Login.js @@ -8,11 +8,12 @@ import { Bert } from 'meteor/themeteorchef:bert'; import OAuthLoginButtons from '../../components/OAuthLoginButtons/OAuthLoginButtons'; import AccountPageFooter from '../../components/AccountPageFooter/AccountPageFooter'; import validate from '../../../modules/validate'; - +import { translate } from 'react-i18next'; class Login extends React.Component { constructor(props) { super(props); + this.t = props.t; this.handleSubmit = this.handleSubmit.bind(this); } @@ -31,11 +32,11 @@ class Login extends React.Component { }, messages: { emailAddress: { - required: 'Need an email address here.', - email: 'Is this email address correct?', + required: this.t("Necesitamos un correo aquí."), + email: this.t("¿Es este correo correcto?"), }, password: { - required: 'Need a password here.', + required: this.t("Necesitamos una contraseña aquí."), }, }, submitHandler() { component.handleSubmit(); }, @@ -49,7 +50,7 @@ class Login extends React.Component { if (error) { Bert.alert(error.reason, 'danger'); } else { - Bert.alert('Welcome back!', 'success'); + Bert.alert(this.t('Bienvenid@ de nuevo'), 'success'); } }); } @@ -58,21 +59,21 @@ class Login extends React.Component { return (
-

Log In

+

{this.t("Iniciar sesión")}

(this.form = form)} onSubmit={event => event.preventDefault()}> - Email Address + {this.t("Correo electrónico")} - Password - Forgot password? + {this.t("Contraseña")} + {this.t("¿Olvidaste tu contraseña?")} - + -

{'Don\'t have an account?'} Sign Up.

+

{this.t("¿No tienes una cuenta?")} {this.t("Regístrate")}.

@@ -107,4 +108,4 @@ Login.propTypes = { history: PropTypes.object.isRequired, }; -export default Login; +export default translate([], { wait: true })(Login); diff --git a/imports/ui/pages/Logout/Logout.js b/imports/ui/pages/Logout/Logout.js index 127c35c..329f072 100644 --- a/imports/ui/pages/Logout/Logout.js +++ b/imports/ui/pages/Logout/Logout.js @@ -1,5 +1,6 @@ import React from 'react'; import Icon from '../../components/Icon/Icon'; +import { translate, Trans } from 'react-i18next'; import './Logout.scss'; @@ -11,16 +12,11 @@ class Logout extends React.Component { render() { return (
- Clever Beagle -

Stay safe out there.

-

{'Don\'t forget to like and follow Clever Beagle elsewhere on the web:'}

+

Gracias por Participar

+

También puedes seguirnos en la web

    -
  • -
  • -
  • +
  • +
); @@ -29,4 +25,4 @@ class Logout extends React.Component { Logout.propTypes = {}; -export default Logout; +export default translate([], { wait: true })(Logout); diff --git a/imports/ui/pages/Logout/Logout.scss b/imports/ui/pages/Logout/Logout.scss index 6eeba19..e43b760 100644 --- a/imports/ui/pages/Logout/Logout.scss +++ b/imports/ui/pages/Logout/Logout.scss @@ -2,8 +2,8 @@ @import '../../stylesheets/colors'; .Logout { - padding: 20px; - background: $cb-blue; + margin: 20px; + background: $todos-palette3; text-align: center; border-radius: 3px; color: #fff; @@ -19,7 +19,7 @@ p { font-size: 18px; - color: lighten($cb-blue, 25%); + color: lighten($todos-palette3, 25%); } ul { diff --git a/imports/ui/pages/Profile/Profile.js b/imports/ui/pages/Profile/Profile.js index c2ddb32..d6cf46d 100644 --- a/imports/ui/pages/Profile/Profile.js +++ b/imports/ui/pages/Profile/Profile.js @@ -11,6 +11,7 @@ import { Bert } from 'meteor/themeteorchef:bert'; import { createContainer } from 'meteor/react-meteor-data'; import InputHint from '../../components/InputHint/InputHint'; import validate from '../../../modules/validate'; +import { translate } from 'react-i18next'; import './Profile.scss'; @@ -18,6 +19,7 @@ class Profile extends React.Component { constructor(props) { super(props); + this.t = this.props.t; this.getUserType = this.getUserType.bind(this); this.handleSubmit = this.handleSubmit.bind(this); this.renderOAuthUser = this.renderOAuthUser.bind(this); @@ -31,14 +33,14 @@ class Profile extends React.Component { validate(component.form, { rules: { firstName: { - required: true, + required: true }, lastName: { - required: true, + required: true }, emailAddress: { required: true, - email: true, + email: true }, currentPassword: { required() { @@ -55,20 +57,20 @@ class Profile extends React.Component { }, messages: { firstName: { - required: 'What\'s your first name?', + required: this.t("¿Cuál es tu nombre?"), }, lastName: { - required: 'What\'s your last name?', + required: this.t("¿Cuál es tu apellido?"), }, emailAddress: { - required: 'Need an email address here.', - email: 'Is this email address correct?', + required: this.t("Necesitamos una contraseña aquí."), + email: this.t("¿Es correcto este correo?"), }, currentPassword: { - required: 'Need your current password if changing.', + required: this.t("Necesito tu contraseña si la quieres cambiar."), }, newPassword: { - required: 'Need your new password if changing.', + required: this.t("Necesito tu nueva contraseña si la quieres cambiar."), }, }, submitHandler() { component.handleSubmit(); }, @@ -97,7 +99,7 @@ class Profile extends React.Component { if (error) { Bert.alert(error.reason, 'danger'); } else { - Bert.alert('Profile updated!', 'success'); + Bert.alert(this.t("¡Perfíl actualizado!"), 'success'); } }); @@ -127,7 +129,7 @@ class Profile extends React.Component { github: 'https://github.com/settings/profile', }[service]} target="_blank" - >Edit Profile on {_.capitalize(service)} + >{this.t("Editar perfíl en")} {_.capitalize(service)}
))}
) :
; @@ -138,7 +140,7 @@ class Profile extends React.Component { - First Name + {this.t("Nombre")} - Last Name + {this.t("Apellidos")} - Email Address + {this.t("Correo electrónico")} - Current Password + {this.t("Contraseña actual")} - New Password + {this.t("Nueva contraseña")} (this.newPassword = newPassword)} className="form-control" /> - Use at least six characters. + {this.t("Usa al menos seis caracteres.")} - +
) :
; } @@ -206,7 +208,7 @@ class Profile extends React.Component { return (
-

Edit Profile

+

{this.t("Editar perfíl")}

(this.form = form)} onSubmit={event => event.preventDefault()}> {this.renderProfileForm(loading, user)}
@@ -218,14 +220,14 @@ class Profile extends React.Component { Profile.propTypes = { loading: PropTypes.bool.isRequired, - user: PropTypes.object.isRequired, + user: PropTypes.object.isRequired }; -export default createContainer(() => { +export default translate([], { wait: true })(createContainer(() => { const subscription = Meteor.subscribe('users.editProfile'); return { loading: !subscription.ready(), - user: Meteor.user(), + user: Meteor.user() }; -}, Profile); +}, Profile)); diff --git a/imports/ui/pages/RecoverPassword/RecoverPassword.js b/imports/ui/pages/RecoverPassword/RecoverPassword.js index 8728a4b..1db243f 100644 --- a/imports/ui/pages/RecoverPassword/RecoverPassword.js +++ b/imports/ui/pages/RecoverPassword/RecoverPassword.js @@ -7,10 +7,12 @@ import { Accounts } from 'meteor/accounts-base'; import { Bert } from 'meteor/themeteorchef:bert'; import AccountPageFooter from '../../components/AccountPageFooter/AccountPageFooter'; import validate from '../../../modules/validate'; +import { translate } from 'react-i18next'; class RecoverPassword extends React.Component { constructor(props) { super(props); + this.t = props.t; this.handleSubmit = this.handleSubmit.bind(this); } @@ -37,12 +39,13 @@ class RecoverPassword extends React.Component { handleSubmit() { const { history } = this.props; const email = this.emailAddress.value; + const t = this.props.t; - Accounts.forgotPassword({ email }, (error) => { + Accounts.forgotPassword({ email, t }, (error) => { if (error) { Bert.alert(error.reason, 'danger'); } else { - Bert.alert(`Check ${email} for a reset link!`, 'success'); + Bert.alert(t("checkResetEmail", {email: email}), 'success'); history.push('/login'); } }); @@ -52,13 +55,13 @@ class RecoverPassword extends React.Component { return (
-

Recover Password

+

{this.t("Recupera tu contraseña")}

- Enter your email address below to receive a link to reset your password. + {this.t("Introduce tu correo abajo para recibir un enlace para resetear tu contraseña.")}
(this.form = form)} onSubmit={event => event.preventDefault()}> - Email Address + {this.t("Correo electrónico")} - + -

Remember your password? Log In.

+

{this.t("¿Recuerdas tu contraseña?")} {this.t("Iniciar sesión")}.

@@ -81,4 +84,4 @@ RecoverPassword.propTypes = { history: PropTypes.object.isRequired, }; -export default RecoverPassword; +export default translate([], { wait: true })(RecoverPassword); diff --git a/imports/ui/pages/Signup/Signup.js b/imports/ui/pages/Signup/Signup.js index 520030e..07e69ee 100644 --- a/imports/ui/pages/Signup/Signup.js +++ b/imports/ui/pages/Signup/Signup.js @@ -10,10 +10,14 @@ import OAuthLoginButtons from '../../components/OAuthLoginButtons/OAuthLoginButt import InputHint from '../../components/InputHint/InputHint'; import AccountPageFooter from '../../components/AccountPageFooter/AccountPageFooter'; import validate from '../../../modules/validate'; +import Icon from '../../components/Icon/Icon'; +import './Signup.scss'; +import { translate } from 'react-i18next'; class Signup extends React.Component { constructor(props) { super(props); + this.t = this.props.t; this.handleSubmit = this.handleSubmit.bind(this); } @@ -84,14 +88,21 @@ class Signup extends React.Component { return (
-

Sign Up

+

{this.t("Registrarse")}

+ + + @@ -100,7 +111,7 @@ class Signup extends React.Component { - First Name + {this.t("Nombre")} - Last Name + {this.t("Apellidos")} - Email Address + {this.t("Correo electrónico")} - Password + {this.t("Contraseña")} (this.password = password)} className="form-control" /> - Use at least six characters. + {this.t("Usa al menos seis caracteres.")} - + -

Already have an account? Log In.

+

{this.t("¿Ya tienes un cuenta?")} {this.t("Iniciar sesión")}.

@@ -155,4 +166,4 @@ Signup.propTypes = { history: PropTypes.object.isRequired, }; -export default Signup; +export default translate([], { wait: true })(Signup) diff --git a/imports/ui/pages/Signup/Signup.scss b/imports/ui/pages/Signup/Signup.scss new file mode 100644 index 0000000..ac99a3e --- /dev/null +++ b/imports/ui/pages/Signup/Signup.scss @@ -0,0 +1,3 @@ +.OAuthLoginButton-telegram { + margin-bottom: 10px; +} diff --git a/imports/ui/stylesheets/colors.scss b/imports/ui/stylesheets/colors.scss index 110ea5a..1f47d75 100644 --- a/imports/ui/stylesheets/colors.scss +++ b/imports/ui/stylesheets/colors.scss @@ -23,3 +23,21 @@ $todos-back1: #AC9393; $todos-back2: #FFFFFF; $todos-font1: #280B0B; $todos-font2: #501616; + +$todos-palette1a: #5A7636; +$todos-palette2a: #462F13; +$todos-palette3a: #281D08; +$todos-palette4a: #021704; +$todos-palette5a: #342F2C; + +$todos-palette1b: #0D2E0E; +$todos-palette2b: #425C74; +$todos-palette3b: #70564B; +$todos-palette4b: #D86A25; +$todos-palette5b: #28221D; + +$todos-palette1: $todos-palette1b; +$todos-palette2: $todos-palette2b; +$todos-palette3: $todos-palette3b; +$todos-palette4: $todos-palette4b; +$todos-palette5: $todos-palette5b; diff --git a/imports/ui/stylesheets/custom.scss b/imports/ui/stylesheets/custom.scss index 7b26304..3df3325 100644 --- a/imports/ui/stylesheets/custom.scss +++ b/imports/ui/stylesheets/custom.scss @@ -1,3 +1,7 @@ a, a:hover { - color: $todos-font2; + color: $todos-palette5; +} + +.bg-dark { + background-color: $todos-palette1 !important; } diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 1d78278..5db5383 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -12,5 +12,70 @@ "Licencia": "License", "Cerrar sesión": "Logout", "Registrarse": "Sign Up", - "Iniciar sesión": "Login" + "Iniciar sesión": "Login", + "o regístrate con un correo": "or Sign Up with an Email Address", + "o inicia sesión con un correo": + "or Log In with an Email Address", + "Nombre": + "First Name", + "Apellidos": + "Last Name", + "Correo electrónico": + "Email Address", + "Contraseña": + "Password", + "¿Ya tienes un cuenta?": + "Already have an account?", + "Usa al menos seis caracteres.": + "Use at least six characters.", + "Iniciar sesión con Google": + "Log In with Google", + "¿Olvidaste tu contraseña": + "Forgot password?", + "¿No tienes una cuenta?": + "Don't have an account?", + "Introduce tu correo abajo para recibir un enlace para resetear tu contraseña.": + "Enter your email address below to receive a link to reset your password.", + "Recupera tu contraseña": + "Recover Password", + "¿Recuerdas tu contraseña?": + "Remember your password?", + "Necesitamos un correo aquí.": + "Need an email address here.", + "¿Es este correo correcto?": + "Is this email address correct?", + "Necesitamos una contraseña aquí.": + "Need a password here.", + "Bienvenid@ de nuevo": + "Welcome back!", + "Guardar perfíl": + "Save profile", + "Contraseña actual": + "Current Password", + "Nueva contraseña": + "New Password", + "Editar perfíl": + "Edit Profile", + "Editar perfíl en": + "Edit Profile on", + "¡Perfíl actualizado!": + "Profile updated!", + "¿Cuál es tu nombre?": + "What's your first name?", + "¿Cuál es tu apellido?": + "What's your lastName name?", + "Necesito tu contraseña si la quieres cambiar.": + "Need your current password if changing.", + "Necesito tu nueva contraseña si la quieres cambiar.": + "Need your new password if changing.", + "¿Es correcto este correo?": + "Is this email address correct?", + "verifyEmail": + "Hey friend! Can you verify your email address ({{email}}) for us?", + "Reenviar email de verificación": + "Re-send verification email", + "checkVerificationEmail": + "Check {{email}} for a verification link!", + "checkResetEmail": + "Check ${email} for a reset link!" } diff --git a/public/locales/es/common.json b/public/locales/es/common.json index 0495c7b..379226e 100644 --- a/public/locales/es/common.json +++ b/public/locales/es/common.json @@ -12,5 +12,71 @@ "Licencia": "Licencia", "Cerrar sesión": "Cerrar sesión", "Registrarse": "Registrarse", - "Iniciar sesión": "Iniciar sesión" + "Iniciar sesión": "Iniciar sesión", + "o regístrate con un correo": + "o regístrate con un correo", + "o inicia sesión con un correo": + "o inicia sesión con un correo", + "Nombre": + "Nombre", + "Apellidos": + "Apellidos", + "Correo electrónico": + "Correo electrónico", + "Contraseña": + "Contraseña", + "¿Ya tienes un cuenta?": + "¿Ya tienes un cuenta?", + "Usa al menos seis caracteres.": + "Usa al menos seis caracteres.", + "Iniciar sesión con Google": + "Iniciar sesión con Google", + "¿Olvidaste tu contraseña": + "¿Olvidaste tu contraseña", + "¿No tienes una cuenta?": + "¿No tienes una cuenta?", + "Introduce tu correo abajo para recibir un enlace para resetear tu contraseña.": + "Introduce tu correo abajo para recibir un enlace para resetear tu contraseña.", + "Recupera tu contraseña": + "Recupera tu contraseña", + "¿Recuerdas tu contraseña?": + "¿Recuerdas tu contraseña?", + "Necesitamos un correo aquí.": + "Necesitamos un correo aquí.", + "¿Es este correo correcto?": + "¿Es este correo correcto?", + "Necesitamos una contraseña aquí.": + "Necesitamos una contraseña aquí.", + "Bienvenid@ de nuevo": + "Bienvenid@ de nuevo", + "Guardar perfíl": + "Guardar perfíl", + "Contraseña actual": + "Contraseña actual", + "Nueva contraseña": + "Nueva contraseña", + "Editar perfíl": + "Editar perfíl", + "Editar perfíl en": + "Editar perfíl en", + "¡Perfíl actualizado!": + "¡Perfíl actualizado!", + "¿Cuál es tu nombre?": + "¿Cuál es tu nombre?", + "¿Cuál es tu apellido?": + "¿Cuál es tu apellido?", + "Necesito tu contraseña si la quieres cambiar.": + "Necesito tu contraseña si la quieres cambiar.", + "Necesito tu nueva contraseña si la quieres cambiar.": + "Necesito tu nueva contraseña si la quieres cambiar.", + "¿Es correcto este correo?": + "¿Es correcto este correo?", + "verifyEmail": + "¡Ey! ¿Nos puedes verificar tu correo electrónico ({{email}})?", + "Reenviar email de verificación": + "Reenviar email de verificación", + "checkVerificationEmail": + "¡Comprueba en tu correo {{email}} el enlace de verificación!", + "checkResetEmail": + "¡Comprueba en tu correo {{email}} el enlace de reseteo!" }