hook epochs into Epochs render

This commit is contained in:
Sorrel Bri 2019-12-18 20:11:21 -08:00
parent 9a8563ebd7
commit 368b6ea1fa
4 changed files with 10 additions and 5 deletions

View file

@ -7,14 +7,12 @@
} }
.App-header { .App-header {
background-color: #282c34;
min-height: 100vh; min-height: 100vh;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-size: calc(10px + 2vmin); font-size: calc(10px + 2vmin);
color: white;
} }
.App-link { .App-link {

View file

@ -124,7 +124,9 @@ const PhonoChangeApplier = () => {
<div className="PhonoChangeApplier" data-testid="PhonoChangeApplier"> <div className="PhonoChangeApplier" data-testid="PhonoChangeApplier">
<ProtoLang lexicon={state.lexicon} dispatch={dispatch}/> <ProtoLang lexicon={state.lexicon} dispatch={dispatch}/>
<Features phones={state.phones} features={state.features} dispatch={dispatch}/> <Features phones={state.phones} features={state.features} dispatch={dispatch}/>
<Epochs epochs={epochs} setEpochs={setEpochs} errors={errors}/> <Epochs epochs={state.epochs} dispatch={dispatch}
// setEpochs={setEpochs}
/>
<Options options={options} setOptions={setOptions} runChanges={runChanges}/> <Options options={options} setOptions={setOptions} runChanges={runChanges}/>
<Output results={results} setResults={setResults}/> <Output results={results} setResults={setResults}/>
</div> </div>

View file

@ -10,7 +10,10 @@ const Epochs = props => {
const addEpoch = (e, props) => { const addEpoch = (e, props) => {
e.preventDefault() e.preventDefault()
let index = props.epochs.length + 1; let index = props.epochs.length + 1;
props.setEpochs([...props.epochs, {name: `epoch ${index}`, changes:['[+ feature]>[- feature]/_#']}]) props.dispatch({
type: 'ADD_EPOCH',
value: {name: `Epoch ${index}`}
})
} }
const removeEpoch = (e, epochName) => { const removeEpoch = (e, epochName) => {
@ -33,7 +36,7 @@ const Epochs = props => {
return <SoundChangeSuite return <SoundChangeSuite
key={`epochname-${idx}`} epochIndex={idx} epoch={epoch} key={`epochname-${idx}`} epochIndex={idx} epoch={epoch}
updateEpoch={updateEpoch} removeEpoch={removeEpoch} updateEpoch={updateEpoch} removeEpoch={removeEpoch}
error={props.errors[epoch.name]} // error={props.errors[epoch.name]}
/>}) />})
: <></>} : <></>}
<form onSubmit={e=>addEpoch(e, props)}> <form onSubmit={e=>addEpoch(e, props)}>

View file

@ -5,6 +5,8 @@ body {
sans-serif; sans-serif;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
background-color: #111;
color: #EEE;
} }
code { code {