Cleaned up code for mapping state to jsx in SearchPage

This commit is contained in:
Ken Jannette
2018-04-20 16:58:26 -04:00
parent 58f54cd119
commit 71f5d958e8

View File

@@ -37,10 +37,9 @@ class SearchPage extends Component {
</div>
<div className="search-books-results">
<ol className="books-grid">
this.state.results.map((result) => (
<li key={result.id}>
{
this.state.results.map((result) => {
return <li key={result.id}>
<div className="book">
<div className="book-top">
<div className="book-cover" style={{ width: 128, height: 193, backgroundImage: `url("${ result.imageLinks.thumbnail }")` }}></div>
@@ -58,9 +57,8 @@ class SearchPage extends Component {
<div className="book-authors">{result.authors}</div>
</div>
</li>
)
}
}
</ol>
</div>
</div>