{"size": 1154, "ext": "js", "max_stars_repo_path": "src/index.js", "max_stars_repo_name": "OkoyeMoses90/Calculator-App", "max_stars_repo_stars_event_min_datetime": "2019-12-15T07:32:24.000Z", "max_stars_repo_stars_event_max_datetime": "2019-12-15T07:32:24.000Z", "max_issues_repo_path": "src/index.js", "max_issues_repo_name": "OkoyeMoses90/Calculator-App", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/index.js", "max_forks_repo_name": "OkoyeMoses90/Calculator-App", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 27.4761904762, "max_line_length": 106, "alphanum_fraction": 0.5953206239}
import React from 'react';
import ReactDOM from 'react-dom';
import CalculatorButtonsArea from './components/buttonsarea';
import CalculatorScreen from './components/calculatorscreen';
import './index.css';

class CalculatorBody extends React.Component {
    constructor() {
        super();
        this.state = {
            currentValue: "0",
            equation: "",
        }
    }

    changeCurrentValue(newValue) {
        this.setState({ currentValue: newValue });
    }

    changeEquation(newValue) {
        this.setState({ equation: newValue });
    }

    render() {
        return (
            <div className="calcBody">
                <CalculatorScreen equation={this.state.equation} currentValue={this.state.currentValue} />
                <CalculatorButtonsArea equation={this.state.equation}
                    currentValue={this.state.currentValue}
                    changeEquation={this.changeEquation.bind(this)}
                    changeCurrentValue={this.changeCurrentValue.bind(this)}
                />
            </div>
        )
    }
}

ReactDOM.render(
    <CalculatorBody />,
    document.getElementById('app')
);
