From 21a5a62b60d19f3cfea905f2f3e12bd3ffd360cf Mon Sep 17 00:00:00 2001 From: Sorrel Bri Date: Fri, 29 Nov 2019 16:51:34 -0800 Subject: [PATCH] add function for increasing epochs --- src/components/Epochs.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/components/Epochs.js b/src/components/Epochs.js index 058903f..55e915e 100644 --- a/src/components/Epochs.js +++ b/src/components/Epochs.js @@ -3,11 +3,21 @@ import './Epochs.scss'; import SoundChangeSuite from './SoundChangeSuite'; +const addEpoch = (e, props) => { + console.log(props) + e.preventDefault() + props.setEpochs([...props.epochs, {name: '', changes:['']}]) + console.log(props) +} + const Epochs = props => { return (

Sound Change Epochs

- {props.epochs ? props.epochs.map(epoch => ) : <>} + {props.epochs ? props.epochs.map((epoch, idx) => ) : <>} +
addEpoch(e, props)}> + +
); }