Welcome to MadLibs!
Fill in all of the choices to see your final story.
- {/*
- Render your form with input values
- */}
-
+ {this.visibleStory()}
);
}
diff --git a/src/components/NewStoryForm.css b/src/components/NewStoryForm.css
new file mode 100644
index 0000000..e69de29
diff --git a/src/components/NewStoryForm.js b/src/components/NewStoryForm.js
new file mode 100644
index 0000000..02d3dd9
--- /dev/null
+++ b/src/components/NewStoryForm.js
@@ -0,0 +1,52 @@
+import React, { Component } from 'react';
+import PropTypes from 'prop-types';
+import './NewStoryForm.css';
+
+class NewStoryForm extends Component {
+
+ static propTypes = {
+ updateWord: PropTypes.func.isRequired,
+ words: PropTypes.array.isRequired,
+ }
+
+ onFieldChange = (key, value) => {
+ this.props.updateWord(key, value);
+ }
+
+ onSubmit = (event) => {
+ event.preventDefault();
+ this.props.completedStoryVisibility();
+ }
+
+ render() {
+ let words = this.props.words;
+ let wordInput = words.map((word) => {
+ return(
+