stub parse_latl reducer action

This commit is contained in:
Sorrel Bri 2020-03-01 20:55:23 -08:00
parent 6bdd0a9d65
commit d5d1eb2fa2
4 changed files with 15 additions and 6 deletions

View file

@ -5,20 +5,21 @@ const Latl = ({latl, dispatch}) => {
const { innerWidth, innerHeight } = window;
const handleChange = e => {
console.log(e.target.value)
const setLatlAction = {
type: 'SET_LATL',
value: e.target.value
}
dispatch(setLatlAction)
dispatch(setLatlAction);
}
return (
<div className="Latl">
<h3>.LATL</h3>
<textarea name="latl" id="latl"
cols={'' + Math.floor(innerWidth / 15)} rows={'' + Math.floor(innerHeight / 30)}
onChange={e => dispatch({type:'SET_LATL', value: e.target.value})}
value={latl}
cols={'' + Math.floor(innerWidth / 15)}
rows={'' + Math.floor(innerHeight / 30)}
onChange={handleChange}
/>
</div>
);

View file

@ -2,10 +2,11 @@ import React from 'react';
import './LatlOutput.scss';
const LatlOutput = ({results, options, dispatch}) => {
return (
<div className="LatlOutput">
<h3>Output</h3>
<form action={() => {}}>
<form>
<input
className="form form--remove"
type="submit"

View file

@ -12,7 +12,7 @@ import type { resultsAction } from './reducer.results'
import { initState } from './reducer.init';
import type { initAction } from './reducer.init';
import { clearOutput } from './reducer.clear';
import { setLatl } from './reducer.latl';
import { setLatl, parseLatl } from './reducer.latl';
export type stateType = {
lexicon: Array<{lexeme: string, epoch: epochType}>,
@ -63,6 +63,8 @@ export const stateReducer = (state: stateType, action: actionType): stateType =>
case 'SET_LATL': return setLatl(state, action);
case 'PARSE_LATL': return parseLatl(state, action);
case 'CLEAR': return clearOutput(state, action);
case 'RUN': return run(state, action);

View file

@ -3,4 +3,9 @@
export const setLatl = (state, action) => {
let latl = action.value;
return {...state, latl};
}
export const parseLatl = (state, action) => {
let latl = state.action;
return { ...state }
}