From f4ea98d724d73c2b053d1464e6a38a0008ed864b Mon Sep 17 00:00:00 2001 From: Georgi Angelov Date: Tue, 22 Oct 2024 15:56:17 +0300 Subject: [PATCH] Under 13 -> under 16 --- src/components/join-flow/email-step.jsx | 10 +++++----- src/components/join-flow/join-flow.jsx | 18 +++++++++--------- src/components/join-flow/welcome-step.jsx | 6 +++--- src/l10n.json | 6 +++--- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/components/join-flow/email-step.jsx b/src/components/join-flow/email-step.jsx index d50cb354a..1a3d5f745 100644 --- a/src/components/join-flow/email-step.jsx +++ b/src/components/join-flow/email-step.jsx @@ -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 }; diff --git a/src/components/join-flow/join-flow.jsx b/src/components/join-flow/join-flow.jsx index 14319bce9..699c8c88e 100644 --- a/src/components/join-flow/join-flow.jsx +++ b/src/components/join-flow/join-flow.jsx @@ -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 { @@ -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} /> diff --git a/src/components/join-flow/welcome-step.jsx b/src/components/join-flow/welcome-step.jsx index 4c5598455..86531a677 100644 --- a/src/components/join-flow/welcome-step.jsx +++ b/src/components/join-flow/welcome-step.jsx @@ -76,8 +76,8 @@ class WelcomeStep extends React.Component {