Created
September 5, 2017 17:47
-
-
Save JavierPons/d936425ecc6fe446649f29428d0d121c to your computer and use it in GitHub Desktop.
Ravenous
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
import React from 'react'; | |
import './searchBar.css'; | |
const sortByOptions{ | |
'Best Match': 'best_match', | |
'Highest Rated': 'rating', | |
'Most Reviewed': 'review_count' | |
} | |
class SearchBar extends React.Component{ | |
render( | |
<div className="SearchBar"> | |
<div className="SearchBar-sort-options"> | |
<ul> | |
.renderSortByOptions() | |
</ul> | |
</div> | |
<div className="SearchBar-fields"> | |
<input placeholder="Search Businesses" /> | |
<input placeholder="Where?" /> | |
</div> | |
<div className="SearchBar-submit"> | |
<a>Let's Go</a> | |
</div> | |
</div> | |
) | |
return sortByOptions.keys(sortByoptions).map(sortByOption =>{ | |
let sortByOptionValue = sortByOptions[sortByOption]; | |
return <li key=`{sortByOptionValue}`>`{sortByOption}` </li>; | |
}); | |
} | |
export default SearchBar; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment