Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/lint onboarding slides #4240

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Reverting snake-to-camelcase changes and disabling linter rule in T&C…
… slide
  • Loading branch information
daningenthron committed Oct 12, 2019
commit 3eb729079776f341503973c449bf9a55d7ada4c7
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint camelcase: "off" */

import { h, Component } from 'preact';
import PropTypes from 'prop-types';

Expand All @@ -13,10 +15,10 @@ class EmailTermsConditionsForm extends Component {
this.checkRequirements = this.checkRequirements.bind(this);

this.state = {
checkedCodeOfConduct: false,
checkedTermsAndConditions: false,
emailMembershipNewsletter: true,
emailDigestPeriodic: true,
checked_code_of_conduct: false,
checked_terms_and_conditions: false,
email_membership_newsletter: true,
email_digest_periodic: true,
message: '',
textShowing: null,
};
Expand Down Expand Up @@ -59,14 +61,17 @@ class EmailTermsConditionsForm extends Component {
}

checkRequirements() {
const { checkedCodeOfConduct, checkedTermsAndConditions } = this.state;
if (!checkedCodeOfConduct) {
const {
checked_code_of_conduct,
checked_terms_and_conditions,
} = this.state;
if (!checked_code_of_conduct) {
this.setState({
message: 'You must agree to our Code of Conduct before continuing!',
});
return false;
}
if (!checkedTermsAndConditions) {
if (!checked_terms_and_conditions) {
this.setState({
message:
'You must agree to our Terms and Conditions before continuing!',
Expand Down Expand Up @@ -95,10 +100,10 @@ class EmailTermsConditionsForm extends Component {
render() {
const {
message,
checkedCodeOfConduct,
checkedTermsAndConditions,
emailMembershipNewsletter,
emailDigestPeriodic,
checked_code_of_conduct,
checked_terms_and_conditions,
email_membership_newsletter,
email_digest_periodic,
textShowing,
} = this.state;
const { prev } = this.props;
Expand Down Expand Up @@ -129,8 +134,8 @@ class EmailTermsConditionsForm extends Component {
<input
type="checkbox"
id="checked_code_of_conduct"
name="checkedCodeOfConduct"
checked={checkedCodeOfConduct}
name="checked_code_of_conduct"
checked={checked_code_of_conduct}
onChange={this.handleChange}
/>
You agree to uphold our
Expand All @@ -147,8 +152,8 @@ class EmailTermsConditionsForm extends Component {
<input
type="checkbox"
id="checked_terms_and_conditions"
name="checkedTermsAndConditions"
checked={checkedTermsAndConditions}
name="checked_terms_and_conditions"
checked={checked_terms_and_conditions}
onChange={this.handleChange}
/>
You agree to our
Expand All @@ -166,8 +171,8 @@ class EmailTermsConditionsForm extends Component {
<input
type="checkbox"
id="email_membership_newsletter"
name="emailMembershipNewsletter"
checked={emailMembershipNewsletter}
name="email_membership_newsletter"
checked={email_membership_newsletter}
onChange={this.handleChange}
/>
Do you want to receive our weekly newsletter emails?
Expand All @@ -177,8 +182,8 @@ class EmailTermsConditionsForm extends Component {
<input
type="checkbox"
id="email_digest_periodic"
name="emailDigestPeriodic"
checked={emailDigestPeriodic}
name="email_digest_periodic"
checked={email_digest_periodic}
onChange={this.handleChange}
/>
Do you want to receive a periodic digest with some of the top
Expand Down