diff --git a/src/components/Options.js b/src/components/Options.js
index f4ef7bc..33eb612 100644
--- a/src/components/Options.js
+++ b/src/components/Options.js
@@ -24,14 +24,20 @@ const Options = ({ options, dispatch }) => {
});
}
+ const handleOutputClearSubmit = e => {
+ e.preventDefault();
+ console.log('clearing')
+ dispatch({
+ type: 'CLEAR',
+ value: {}
+ });
+ }
+
return (
Modeling Options
-
+ */}
);
}
diff --git a/src/components/Options.scss b/src/components/Options.scss
index 3fc726f..263ca2f 100644
--- a/src/components/Options.scss
+++ b/src/components/Options.scss
@@ -1,8 +1,8 @@
div.Options {
form {
- display: flex;
- flex-flow: column nowrap;
+ display: grid;
+ grid-template-columns: 1fr 1fr;
}
}
\ No newline at end of file
diff --git a/src/reducers/reducer.clear.js b/src/reducers/reducer.clear.js
new file mode 100644
index 0000000..0a94b19
--- /dev/null
+++ b/src/reducers/reducer.clear.js
@@ -0,0 +1,3 @@
+export const clearOutput = (state, action) => {
+ return { ...state, results: [], errors: {} };
+}
\ No newline at end of file
diff --git a/src/reducers/reducer.js b/src/reducers/reducer.js
index 92de082..b14da78 100644
--- a/src/reducers/reducer.js
+++ b/src/reducers/reducer.js
@@ -11,6 +11,7 @@ import { run } from './reducer.results';
import type { resultsAction } from './reducer.results'
import { initState } from './reducer.init';
import type { initAction } from './reducer.init';
+import { clearOutput } from './reducer.clear';
export type stateType = {
lexicon: Array<{lexeme: string, epoch: epochType}>,
@@ -57,6 +58,8 @@ export const stateReducer = (state: stateType, action: actionType): stateType =>
case 'SET_OPTIONS': return setOptions(state, action);
+ case 'CLEAR': return clearOutput(state, action);
+
case 'RUN': return run(state, action);
default: return state;
diff --git a/src/reducers/reducer.results.js b/src/reducers/reducer.results.js
index dba1101..ca86976 100644
--- a/src/reducers/reducer.results.js
+++ b/src/reducers/reducer.results.js
@@ -280,6 +280,6 @@ export const run = (state: stateType, action: resultsAction): stateType => {
return {...state, results, errors: {} }
} catch (err) {
console.log(err)
- return {...state, errors: err };
+ return {...state, errors: err, results:[] };
}
}
\ No newline at end of file