<commit_before>/** @jsx React.DOM */

var React = require("react");
var calculate = require("../../common/calculate");
var InputDistanceSinceFill = require("./InputDistanceSinceFill.jsx");
var InputFuelAdded = require("./InputFuelAdded.jsx");
var InputCost = require("./InputCost.jsx");
var DivCurrentMPG = require("./DivCurrentMPG.jsx");

var App = React.createClass({
	updateDistanceValue: function(distanceInput){
		this.setState({
			distance: distanceInput
		});
	},
	
	updateFuelValue: function(fuel){
		this.setState({
			fuel: fuel
		});
	},

	getCurrentMPG: function(distance, fuel) {
		if(distance && fuel) {
			return calculate.getFuelEconomy(distance, fuel);	
		}
		return 0;
	},

	getInitialState: function() {
		return {
			distance: 0,
			fuel: 0
		}
	},

	getDefaultProps: function() {
		return {
			currentMPG: 0
		}
	},

	shouldComponentUpdate: function(newProps, newState) {
		return newState.distance && newState.fuel;
	},

	render: function() {

		var currentMPG = this.getCurrentMPG(this.state.distance, this.state.fuel);

		return (
			<form method="post">
				<InputDistanceSinceFill updateDistanceValue={this.updateDistanceValue} />
				<InputFuelAdded updateFuelValue={this.updateFuelValue} />
				<InputCost />
				<DivCurrentMPG currentMPG={currentMPG} />
				<button type="submit">Submit</button>

				<input type="hidden" name="_user" value="550f9e8ce4b0e5b0b43a0e72" />
				<input type="hidden" name="_vehicle" value="550f9f68e4b0e5b0b43a0e76" />
			</form>
		);
	}
});

module.exports = App;<commit_msg>Updated route for form submission to match API.<commit_after>/** @jsx React.DOM */

var React = require("react");
var calculate = require("../../common/calculate");
var InputDistanceSinceFill = require("./InputDistanceSinceFill.jsx");
var InputFuelAdded = require("./InputFuelAdded.jsx");
var InputCost = require("./InputCost.jsx");
var DivCurrentMPG = require("./DivCurrentMPG.jsx");

var App = React.createClass({
	updateDistanceValue: function(distanceInput){
		this.setState({
			distance: distanceInput
		});
	},
	
	updateFuelValue: function(fuel){
		this.setState({
			fuel: fuel
		});
	},

	getCurrentMPG: function(distance, fuel) {
		if(distance && fuel) {
			return calculate.getFuelEconomy(distance, fuel);	
		}
		return 0;
	},

	getInitialState: function() {
		return {
			distance: 0,
			fuel: 0
		}
	},

	getDefaultProps: function() {
		return {
			currentMPG: 0
		}
	},

	shouldComponentUpdate: function(newProps, newState) {
		return newState.distance && newState.fuel;
	},

	render: function() {

		var currentMPG = this.getCurrentMPG(this.state.distance, this.state.fuel);

		return (
			<form method="post" action="/entries">
				<InputDistanceSinceFill updateDistanceValue={this.updateDistanceValue} />
				<InputFuelAdded updateFuelValue={this.updateFuelValue} />
				<InputCost />
				<DivCurrentMPG currentMPG={currentMPG} />
				<button type="submit">Submit</button>

				<input type="hidden" name="_user" value="5<PASSWORD>8<PASSWORD>" />
				<input type="hidden" name="_vehicle" value="550f9f68e4b0e5b0b43a0e76" />
			</form>
		);
	}
});

module.exports = App;
{'fraction_non_alphanumeric': 0.15224358974358973, 'fraction_numerical': 0.01730769230769231, 'mean_word_length': 4.371772805507745, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '7629511', 'n_tokens_mistral': 1190, 'n_tokens_neox': 1040, 'n_words': 189}