Under 13 -> under 16

This commit is contained in:
Georgi Angelov 2024-10-22 15:56:17 +03:00
parent 5b35c81f72
commit f4ea98d724
4 changed files with 20 additions and 20 deletions

View file

@ -98,12 +98,12 @@ class EmailStep extends React.Component {
this.captchaRef = ref;
}
render () {
const title = this.props.under13 ?
this.props.intl.formatMessage({id: 'registration.under13.emailStepTitle'}) :
const title = this.props.under16 ?
this.props.intl.formatMessage({id: 'registration.under16.emailStepTitle'}) :
this.props.intl.formatMessage({id: 'registration.emailStepTitle'});
const description = this.props.under13 ?
this.props.intl.formatMessage({id: 'registration.under13.emailStepDescription'}) :
const description = this.props.under16 ?
this.props.intl.formatMessage({id: 'registration.under16.emailStepDescription'}) :
null;
return (
@ -215,7 +215,7 @@ EmailStep.propTypes = {
onNextStep: PropTypes.func,
sendAnalytics: PropTypes.func.isRequired,
waiting: PropTypes.bool,
under13: PropTypes.bool
under16: PropTypes.bool
};

View file

@ -61,7 +61,7 @@ class JoinFlow extends React.Component {
formData: defaults({}, newFormData, this.state.formData)
};
this.setState(newState, () => {
this.handleSubmitRegistration(this.state.formData, this.isUnder13());
this.handleSubmitRegistration(this.state.formData, this.isUnder16());
});
}
getErrorsFromResponse (err, body, res) {
@ -175,7 +175,7 @@ class JoinFlow extends React.Component {
});
});
}
handleSubmitRegistration (formData, isUnder13) {
handleSubmitRegistration (formData, isUnder16) {
this.setState({
registrationError: null, // clear any existing error
waiting: true
@ -191,7 +191,7 @@ class JoinFlow extends React.Component {
'password': formData.password,
'birth_month': formData.birth_month,
'birth_year': formData.birth_year,
'under_13': isUnder13,
'under_16': isUnder16,
'g-recaptcha-response': formData['g-recaptcha-response'],
'gender': formData.gender,
'country': formData.country,
@ -214,7 +214,7 @@ class JoinFlow extends React.Component {
}
handleErrorNext () {
if (this.canTryAgain()) {
this.handleSubmitRegistration(this.state.formData, this.isUnder13());
this.handleSubmitRegistration(this.state.formData, this.isUnder16());
} else {
this.resetState();
}
@ -237,7 +237,7 @@ class JoinFlow extends React.Component {
}
}
isUnder13 () {
isUnder16 () {
const birthYear = this.parseDateComponent(this.state.formData.birth_year);
const birthMonth = this.parseDateComponent(this.state.formData.birth_month);
@ -249,11 +249,11 @@ class JoinFlow extends React.Component {
const now = new Date();
const yearDiff = now.getFullYear() - birthYear;
if (yearDiff > 13) {
if (yearDiff > 16) {
return false;
}
if (yearDiff < 13) {
if (yearDiff < 16) {
return true;
}
@ -298,7 +298,7 @@ class JoinFlow extends React.Component {
<EmailStep
sendAnalytics={this.sendAnalytics}
waiting={this.state.waiting}
under13={this.isUnder13()}
under16={this.isUnder16()}
onCaptchaError={this.handleCaptchaError}
onNextStep={this.handlePrepareToRegister}
/>
@ -307,7 +307,7 @@ class JoinFlow extends React.Component {
email={this.state.formData.email}
sendAnalytics={this.sendAnalytics}
username={this.state.formData.username}
under13={this.isUnder13()}
under16={this.isUnder16()}
onNextStep={this.props.onCompleteRegistration}
/>
</Progression>

View file

@ -76,8 +76,8 @@ class WelcomeStep extends React.Component {
<div className="join-flow-instructions">
<FormattedMessage
id={
this.props.under13 ?
'registration.under13.welcomeStepInstructions' :
this.props.under16 ?
'registration.under16.welcomeStepInstructions' :
'registration.welcomeStepInstructions'
}
values={{
@ -100,7 +100,7 @@ WelcomeStep.propTypes = {
onNextStep: PropTypes.func,
sendAnalytics: PropTypes.func,
username: PropTypes.string,
under13: PropTypes.bool
under16: PropTypes.bool
};
module.exports = injectIntl(WelcomeStep);

View file

@ -209,8 +209,8 @@
"registration.genderOptionAnother": "Another gender:",
"registration.genderOptionPreferNotToSay": "Prefer not to say",
"registration.emailStepTitle": "What's your email?",
"registration.under13.emailStepTitle": "What's your parent's email address?",
"registration.under13.emailStepDescription": "We'll send them a link to verify your account.",
"registration.under16.emailStepTitle": "What's your parent's email address?",
"registration.under16.emailStepDescription": "We'll send them a link to verify your account.",
"registration.emailStepInfo": "This will help if you forget your password. This information will not be made public on your account.",
"registration.goToClass": "Go to Class",
"registration.invitedBy": "invited by",
@ -264,7 +264,7 @@
"registration.welcomeStepDescription": "You have successfully set up a Scratch account! You are now a member of the class:",
"registration.welcomeStepDescriptionNonEducator": "Youre now logged in! You can start exploring and creating projects.",
"registration.welcomeStepInstructions": "Want to share and comment? Click the link on the email we sent to {email}.",
"registration.under13.welcomeStepInstructions": "In order to share projects and participate in the Scratch community, your parent needs to confirm your account. They can click on the link in the email we sent to {email}.",
"registration.under16.welcomeStepInstructions": "In order to share projects and participate in the Scratch community, your parent needs to confirm your account. They can click on the link in the email we sent to {email}.",
"registration.welcomeStepPrompt": "To get started, click on the button below.",
"registration.welcomeStepTitle": "Hurray! Welcome to Scratch!",
"registration.welcomeStepTitleNonEducator": "Welcome to Scratch, {username}!",