delindell / houseplant-topia

0 stars 0 forks source link

(OUTDATED) Modal for adding and updating plants #16

Closed delindell closed 4 years ago

delindell commented 4 years ago

User Story

AC

WHEN I click an add or edit plant button THEN it should open a modal (pre-populated or not) AND it should then update state

Dev Notes


- [ ] The PlantFormModal component should establish all the prop-types at the top

- [ ] The state should then be established with all the possible changes via the form to follow and `isEditing: false`

- [ ] There should be a function that does a `forEach` loop over the rooms collection and creates a radio input button for each room on the modal form, so the user can move the plants from one room to another

- [ ] The modal should then have a form in the markup, something like this:
``` - Then a function outside the render like: ``` nameChange = (e) => { e.preventDefault(); this.setState({ plantName: e.target.value }); } ``` - [ ] Following all of the possible inputs there should be a JS ternary, something like: ``` { isEditing ? : } ```
delindell commented 4 years ago

image