Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. // src/screens/home/components/BookCard.js
  2.  
  3. import React from 'react';
  4. import { Link } from 'react-router-dom';
  5. import Card from 'react-bootstrap/Card'
  6.  
  7. const BookCard = ({ book }) => {
  8. let {
  9. title,
  10. subtitle,
  11. imageLinks,
  12. description
  13. } = book.volumeInfo;
  14. return (
  15. <div className="book">
  16. <Card>
  17. {imageLinks
  18. ? <Card.Img variant="top" src={imageLinks.thumbnail} />
  19. : null
  20. }
  21. <Card.Body>
  22. <Card.Title>{title}</Card.Title>
  23. <Card.Subtitle>{subtitle}</Card.Subtitle>
  24. <Card.Text className="book--description">{description}</Card.Text>
  25. <Link className="book--link" to={`/book/${book.id}`}>View</Link>
  26. </Card.Body>
  27. </Card>
  28. </div>
  29. )
  30. }
  31.  
  32. export default BookCard;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement