diff --git a/Procfile b/Procfile old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 9c7fd665..e4a64c3f --- a/README.md +++ b/README.md @@ -2,41 +2,39 @@ * From address book directory, run yarn install, yarn start ### Do -* Import the array of users into index.js -* Create a folder in src called components to hold all our components -* Create the UserDetail and ListOfUsers functional components -* Import and use components in App -* Send the user array into Apps and then into ListOfUsers -* Send the first user from the array down into the UserDetail component +* DONE--- Import the array of users into index.js +* DONE--- Create a folder in src called components to hold all our components +* DONE--- Create the UserDetail and ListOfUsers functional components +* DONE--- Import and use components in App +* DONE--- Send the user array into Apps and then into ListOfUsers +* DONE--- Send the first user from the array down into the UserDetail component ### Do -* Add a button to the ListOfUsers component that says Hide -* Add an onClick to the button and a handler -* Make clicking the button hide the list and change the text to “Show” -* If you click it again it will show the list and change the text back to “Hide” +* DONE--- Add a button to the ListOfUsers component that says Hide +* DONE--- Add an onClick to the button and a handler +* DONE--- Make clicking the button hide the list and change the text to “Show” +* DONE--- If you click it again it will show the list and change the text back to “Hide” ### Do -* Change ListOfUsers to be a class component -* Add a constructor -* Add a property called “state” that is an object -* Add a property on the state object called "visible" -* Add a method called “render” that returns the jsx the function returned +* DONE--- Change ListofUsers to be a class component +* DONE--- Add a constructor +* DONE--- Add a property called “state” that is an object +* DONE--- Add a property on the state object called "visible" +* DONE--- Add a method called “render” that returns the jsx the function returned ### Do -* Add text box anywhere to ListOfUsers with a label “Search” -* In ListOfUsers add a state property “searchText”, default to “” -* Assign searchText to the value attribute of the text box +* DONE--- Add text box anywhere to ListOfUsers with a label “Search” +* DONE--- In ListOfUsers add a state property “searchText”, default to “” +* DONE--- Assign searchText to the value attribute of the text box ### Do -* Add onChange to text box -* In onChange handler function, setState the searchText to the value from the textbox +* DONE--- Add onChange to text box +* DONE--- In onChange handler function, setState the searchText to the value from the textbox ### Do -* Create a variable called currentUser in index.js. -* Define a function in index.js called selectUser that will take a user as a parameter and then set that user as the currentUser. -* Send this function down the child tree so that ListOfUsers can call it -* Change index.js to send currentUser down the child tree instead of App.js hard coding the first one +* DONE--- Create a variable called currentUser in index.js. +* DONE--- Define a function in index.js called selectUser that will take a user as a parameter and then set that user as the currentUser. +* DONE--- Send this function down the child tree so that ListOfUsers can call it +* DONE--- Change index.js to send currentUser down the child tree instead of App.js hard coding the first one (app should give currentUser to UserDetail) * Register click event for ListOfUsers view link, call the function sent into props by parents, supply the argument of whatever user was clicked on. * Re render the components - - diff --git a/circle.yml b/circle.yml old mode 100644 new mode 100755 diff --git a/db.json b/db.json old mode 100644 new mode 100755 diff --git a/package.json b/package.json old mode 100644 new mode 100755 diff --git a/public/favicon.ico b/public/favicon.ico old mode 100644 new mode 100755 diff --git a/public/index.html b/public/index.html old mode 100644 new mode 100755 diff --git a/src/App.css b/src/App.css old mode 100644 new mode 100755 diff --git a/src/App.js b/src/App.js old mode 100644 new mode 100755 index 0042c777..e88c7f4b --- a/src/App.js +++ b/src/App.js @@ -1,17 +1,22 @@ import React from "react"; import logo from "./logo.svg"; import "./App.css"; +import ListofUsers from "./components/ListofUsers" +import UserDetail from "./components/UserDetail" -function App() { + +function App(props) { return (
- To get started, edit src/App.js and save to reload.
-