From 6bdd0a9d6544a1b4e0cf1f14f41c1d06950779ad Mon Sep 17 00:00:00 2001 From: Sorrel Bri Date: Sun, 1 Mar 2020 15:49:56 -0800 Subject: [PATCH] patch revert some of Epoch refactor --- src/components/Epochs.js | 17 +++++++---------- src/components/Latl.js | 14 ++++++++++++-- src/reducers/reducer.latl.js | 3 ++- src/reducers/reducer.latl.test.js | 2 +- 4 files changed, 22 insertions(+), 14 deletions(-) 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