diff --git a/src/components/Epochs.js b/src/components/Epochs.js index 820a1d4..8b7d8e1 100644 --- a/src/components/Epochs.js +++ b/src/components/Epochs.js @@ -7,25 +7,22 @@ import { render } from 'react-dom'; const Epochs = ({epochs, errors, dispatch}) => { - const handleEvent = func => e => { - e.preventDefault(); - return func; - } - - const addEpoch = e => handleEvent(() => { + const addEpoch = e => { + e.preventDefault() let index = epochs.length + 1; dispatch({ type: 'ADD_EPOCH', value: {name: `epoch ${index}`} }) - })(e) + } - const removeEpoch = e => handleEvent( + const removeEpoch = (e, epochName) => { + e.preventDefault() dispatch({ type: 'REMOVE_EPOCH', value: {name: epochName} - }) - )(e); + }); + } const updateEpoch = (epoch, epochIndex) => { const dispatchValue = { diff --git a/src/components/Latl.js b/src/components/Latl.js index 89f6962..ac06eec 100644 --- a/src/components/Latl.js +++ b/src/components/Latl.js @@ -3,12 +3,22 @@ import './Latl.scss'; const Latl = ({latl, dispatch}) => { const { innerWidth, innerHeight } = window; - console.log(innerWidth, innerHeight) + + const handleChange = e => { + console.log(e.target.value) + const setLatlAction = { + type: 'SET_LATL', + value: e.target.value + } + dispatch(setLatlAction) + } + return (

.LATL