Cleaned up code for mapping state to jsx in SearchPage
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user