From 16ca391f62e161e608ab1473e17df31e5b59ba19 Mon Sep 17 00:00:00 2001 From: philawsophizing Date: Tue, 6 Jun 2017 11:29:12 +0300 Subject: [PATCH] Fix var naming, split out button component, ref #22 --- src/components/search_list.jsx | 29 +++++++++++----------------- src/containers/select_guesthouse.jsx | 8 +++++--- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/src/components/search_list.jsx b/src/components/search_list.jsx index f4ebbc4..48c251e 100644 --- a/src/components/search_list.jsx +++ b/src/components/search_list.jsx @@ -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 => + (
- {props.db.map((guestHouses) => { - const boundItemClick = handleClick.bind(this, guestHouses.name); - return ( - - ); - })} + {props.db.map(guestHouses => + // const boundItemClick = handleClick.bind(this, guestHouses.name); + , + )}
); -}; export default SearchList; diff --git a/src/containers/select_guesthouse.jsx b/src/containers/select_guesthouse.jsx index fe0298f..1cb992d 100644 --- a/src/containers/select_guesthouse.jsx +++ b/src/containers/select_guesthouse.jsx @@ -10,6 +10,8 @@ class SelectGuesthouse extends Component { constructor(props) { super(props); this.state = { + title: 'PAS', + tagLine: 'Park & Sleep', db: [], currentGuestHouse: {}, }; @@ -17,9 +19,9 @@ class SelectGuesthouse extends Component { } currentGuestHouse(guestHouse) { - const current = this.state.db.filter((curr) => { - if (curr.name === guestHouse) { - return curr; + const current = this.state.db.filter((GHouse) => { + if (GHouse.name === guestHouse) { + return GHouse; } return current; });