Guest User

Untitled

a guest
Jul 21st, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. import React, { Component } from 'react'
  2. import Book from './Book'
  3.  
  4. class BookShelf extends Component {
  5. returnBookComponent(array) {
  6. return array.map((item) => {
  7. return (
  8. <li>
  9. <Book
  10. title={item.title}
  11. authors={item.authors}
  12. image={item.imageLinks.thumbnail}
  13. />
  14. </li>
  15. )
  16. })
  17. }
  18.  
  19. render () {
  20. const currentlyReading = this.props.currentlyReading
  21. return (
  22. <div className="bookshelf">
  23. <h2 className="bookshelf-title">{this.props.title}</h2>
  24. <div className="bookshelf-books">
  25. <ol className="books-grid">
  26. {this.returnBookComponent(currentlyReading)}
  27. </ol>
  28. </div>
  29. </div>
  30.  
  31. )
  32. }
  33. }
  34.  
  35. export default BookShelf
Add Comment
Please, Sign In to add comment