Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React, { useState, useEffect } from 'react';
- import './styles/BookShelf.css';
- import { Card, Button } from 'react-bootstrap';
- import { motion } from 'framer-motion';
- function BookShelf() {
- const [books, setBooks] = useState([
- {
- id: 1,
- title: 'The Great Gatsby',
- author: 'F. Scott Fitzgerald',
- publishedDate: 'April 10, 1925',
- description:
- '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.',
- coverImageUrl: 'https://images.pexels.com/photos/256545/pexels-photo-256545.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940'
- },
- {
- id: 2,
- title: 'To Kill a Mockingbird',
- author: 'Harper Lee',
- publishedDate: 'July 11, 1960',
- description:
- '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.',
- coverImageUrl: 'https://images.pexels.com/photos/2436726/pexels-photo-2436726.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940'
- },
- {
- id: 3,
- title: 'The Catcher in the Rye',
- author: 'J.D. Salinger',
- publishedDate: 'July 16, 1951',
- description:
- '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.',
- coverImageUrl: 'https://images.pexels.com/photos/3761743/pexels-photo-3761743.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940'
- },
- {
- id: 4,
- title: 'Pride and Prejudice',
- author: 'Jane Austen',
- publishedDate: 'January 28, 1813',
- description:
- '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.',
- coverImageUrl: 'https://images.pexels.com/photos/259962/pexels-photo-259962.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940'
- }
- ]);
- return (
- <div className="book-list-container">
- <h2>Book List</h2>
- <div className="book-list">
- {books.map(book => (
- <div className="book" key={book.id}>
- <img src={book.coverImageUrl} alt={book.title} />
- <h3>{book.title}</h3>
- <p>{book.author}</p>
- <p>{book.publishedDate}</p>
- <p>{book.description}</p>
- </div>
- ))}
- </div>
- </div>
- );
- }
- export default BookShelf;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement