{"size": 1537, "ext": "js", "max_stars_repo_path": "src/signIn/index.js", "max_stars_repo_name": "planlodge/Propelx-Sign-Up-Flow", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/signIn/index.js", "max_issues_repo_name": "planlodge/Propelx-Sign-Up-Flow", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/signIn/index.js", "max_forks_repo_name": "planlodge/Propelx-Sign-Up-Flow", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.6461538462, "max_line_length": 57, "alphanum_fraction": 0.4593363696}
import React, { Component } from 'react';

import                           './signIn.css'
import SignUp               from './steps/signUp'
import InvestorType         from './steps/investorType'
import Survey               from './steps/survey'

let data = {
    firstName: null,
    lastName: null,
    email: null,
    pass: null,
    accredited: false,
    investorType: null,
    technologies: [],
    sectors: [],
    investments: 0
}

export default class SignIn extends Component {

    state = {
        step: 1
    }

    static propTypes = {}

    nextStep = () => {
        if (this.state.step >= 3) {
            this.setState(prevState => ({
                step: 1
            }))
            return alert("Profile Completed!")
        }

        this.setState(prevState => ({
            step: this.state.step + 1
        }))

    }

    saveValues = (fields) => {
        data = Object.assign({}, data, fields)
        console.log(data)
    }

    render() {

        switch (this.state.step) {
            case 1:
                return <SignUp
                        nextStep = {this.nextStep}
                        saveValues = {this.saveValues} />
            case 2:
                return <InvestorType
                        nextStep = {this.nextStep}
                        saveValues = {this.saveValues} />
            case 3:
                return <Survey
                        nextStep = {this.nextStep}
                        saveValues = {this.saveValues} />
            default:
        }
    }
}