<commit_before>import React, { Component } from 'react';
import { API_BASE_URL } from '../config';
import '../assets/interest.scss';
import B from '../assets/images/b.png';

export class InterestSignupForm extends Component {
    constructor (props) {
        super(props);
        this.state = {
            message: null,
            success: null,
            email: ""
        };
    }
    handleSubmit = (event) => {
        event.preventDefault();
        event.stopPropagation();
        let d = new FormData();
        d.append('email', this.state.email);
        return fetch(`${API_BASE_URL}/interest/signup`,{
            method: 'POST',
            body: d
        }).then((response) => response.json())
            .then((json) => {
                this.setState({success: json.success});
                if(json.success === false) {
                    this.setState({message: json.message});
                    this.props.recordEvent("interestForm:submit_error",json.message);
                }
                else {
                    this.setState({message: json.data});
                    //upon success, clear the form.
                    this.setState({email: ""});
                    this.props.recordEvent("interestForm:submit_success")
                }
            });
    };
    changeEmail(event) {
        this.setState({email: event.target.value});
    }

    render () {
        let canSubmit = (this.state.email.length > 3);
        return (
          <div className="con flexCon">
            <div className="flexchild">
              <h1 className="darkBlue">BoilerMake</h1><commit_msg>fix interest form test<commit_after>import React, { Component } from 'react';
import { API_BASE_URL } from '../config';
import '../assets/interest.scss';
import B from '../assets/images/b.png';

export class InterestSignupForm extends Component {
    constructor (props) {
        super(props);
        this.state = {
            message: null,
            success: null,
            email: ""
        };
    }
    handleSubmit = (event) => {
        if(event) {
            //so tests don't get funky
            event.preventDefault();
            event.stopPropagation();
        }
        let d = new FormData();
        d.append('email', this.state.email);
        return fetch(`${API_BASE_URL}/interest/signup`,{
            method: 'POST',
            body: d
        }).then((response) => response.json())
            .then((json) => {
                this.setState({success: json.success});
                if(json.success === false) {
                    this.setState({message: json.message});
                    this.props.recordEvent("interestForm:submit_error",json.message);
                }
                else {
                    this.setState({message: json.data});
                    //upon success, clear the form.
                    this.setState({email: ""});
                    this.props.recordEvent("interestForm:submit_success")
                }
            });
    };
    changeEmail(event) {
        this.setState({email: event.target.value});
    }

    render () {
        let canSubmit = (this.state.email.length > 3);
        return (
          <div className="con flexCon">
            <div className="flexchild">
              <h1 className="darkBlue">BoilerMake</h1>
{'fraction_non_alphanumeric': 0.13827234553089382, 'fraction_numerical': 0.001799640071985603, 'mean_word_length': 1.6384493670886076, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2631939', 'n_tokens_mistral': 876, 'n_tokens_neox': 860, 'n_words': 170}