Advertisement
SnoopSheep2001

Untitled

Apr 14th, 2023
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.16 KB | None | 0 0
  1. import React, { useState, useEffect } from 'react';
  2. import './styles/BookShelf.css';
  3. import { Card, Button } from 'react-bootstrap';
  4. import { motion } from 'framer-motion';
  5.  
  6. function BookShelf() {
  7. const [books, setBooks] = useState([
  8. {
  9. id: 1,
  10. title: 'The Great Gatsby',
  11. author: 'F. Scott Fitzgerald',
  12. publishedDate: 'April 10, 1925',
  13. description:
  14. 'The Great Gatsby is a novel by American author F. Scott Fitzgerald. It was first published in 1925, and is set on Long Island’s North Shore and in New York City in the summer of 1922. The novel chronicles the events of Jay Gatsby, a millionaire who is obsessed with his former love, Daisy Buchanan.',
  15. coverImageUrl: 'https://images.pexels.com/photos/256545/pexels-photo-256545.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940'
  16. },
  17. {
  18. id: 2,
  19. title: 'To Kill a Mockingbird',
  20. author: 'Harper Lee',
  21. publishedDate: 'July 11, 1960',
  22. description:
  23. 'To Kill a Mockingbird is a novel by Harper Lee published in 1960. It was immediately successful, winning the Pulitzer Prize, and has become a classic of modern American literature. The plot and characters are loosely based on the author\'s observations of her family, her neighbors and an event that occurred near her hometown of Monroeville, Alabama, in 1936, when she was 10 years old.',
  24. coverImageUrl: 'https://images.pexels.com/photos/2436726/pexels-photo-2436726.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940'
  25. },
  26. {
  27. id: 3,
  28. title: 'The Catcher in the Rye',
  29. author: 'J.D. Salinger',
  30. publishedDate: 'July 16, 1951',
  31. description:
  32. 'The Catcher in the Rye is a novel by J.D. Salinger, published in 1951. It is narrated by Holden Caulfield, a cynical teenager who has been expelled from prep school and is on his way home to New York City. The novel explores themes of alienation, loss of innocence, and the phoniness of the adult world.',
  33. coverImageUrl: 'https://images.pexels.com/photos/3761743/pexels-photo-3761743.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940'
  34. },
  35. {
  36. id: 4,
  37. title: 'Pride and Prejudice',
  38. author: 'Jane Austen',
  39. publishedDate: 'January 28, 1813',
  40. description:
  41. 'Pride and Prejudice is a romantic novel by Jane Austen, first published in 1813. The story follows the main character Elizabeth Bennet as she deals with issues of manners, upbringing, morality, education, and marriage in the society of the landed gentry of the British Regency.',
  42. coverImageUrl: 'https://images.pexels.com/photos/259962/pexels-photo-259962.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940'
  43. }
  44. ]);
  45. return (
  46. <div className="book-list-container">
  47. <h2>Book List</h2>
  48. <div className="book-list">
  49. {books.map(book => (
  50. <div className="book" key={book.id}>
  51. <img src={book.coverImageUrl} alt={book.title} />
  52. <h3>{book.title}</h3>
  53. <p>{book.author}</p>
  54. <p>{book.publishedDate}</p>
  55. <p>{book.description}</p>
  56. </div>
  57. ))}
  58. </div>
  59. </div>
  60. );
  61. }
  62.  
  63. export default BookShelf;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement