diff --git a/src/components/FuelSavingsForm.js b/src/components/FuelSavingsForm.js new file mode 100644 index 000000000..f3a121c9b --- /dev/null +++ b/src/components/FuelSavingsForm.js @@ -0,0 +1,69 @@ +import React, {PropTypes} from 'react'; +import FuelSavingsResults from './FuelSavingsResults'; +import FuelSavingsTextInput from './FuelSavingsTextInput'; + +// Destrucuring props for brevity below. +const FuelSavingsForm = ({saveFuelSavings, calculateFuelSavings, appState}) => { + const onTimeframeChange = function (e) { + calculateFuelSavings(appState, 'milesDrivenTimeframe', e.target.value); + }; + + const fuelSavingsKeypress = function (name, value) { + calculateFuelSavings(appState, name, value); + }; + + return ( +
+ | |
+ | |
+ | |
+ | |
+ |
+ |
+
+ | {appState.dateModified} | +