-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix var naming, split out button component, ref #22
- Loading branch information
1 parent
513a60b
commit 16ca391
Showing
2 changed files
with
16 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,18 @@ | ||
import React from 'react'; | ||
import SearchButton from './search_button.jsx'; | ||
|
||
const SearchList = (props) => { | ||
const handleClick = (guestHouse) => { | ||
props.updateCurrent(guestHouse); | ||
}; | ||
console.log(props); | ||
|
||
return ( | ||
const SearchList = props => | ||
( | ||
<div> | ||
{props.db.map((guestHouses) => { | ||
const boundItemClick = handleClick.bind(this, guestHouses.name); | ||
return ( | ||
<button | ||
key={guestHouses.name} | ||
onClick={boundItemClick}> | ||
{guestHouses.name} | ||
</button> | ||
); | ||
})} | ||
{props.db.map(guestHouses => | ||
// const boundItemClick = handleClick.bind(this, guestHouses.name); | ||
<SearchButton | ||
key={guestHouses.name} | ||
clickHandler={props.updateCurrent} | ||
currentGHouse={guestHouses.name} | ||
/>, | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default SearchList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters