From 670eb56d8173508f6e841b723a3a22527a17e7f8 Mon Sep 17 00:00:00 2001 From: Sujeet Gupta Date: Thu, 31 Oct 2024 11:09:24 +0530 Subject: [PATCH] created a moviePage that was missing in application --- src/App.js | 2 + src/components/MovieImageSlider.js | 73 ++++++++++++++++++ src/components/MoviePage.js | 114 +++++++++++++++++++++++++++++ 3 files changed, 189 insertions(+) create mode 100644 src/components/MovieImageSlider.js create mode 100644 src/components/MoviePage.js diff --git a/src/App.js b/src/App.js index ca446c1..f0eb751 100644 --- a/src/App.js +++ b/src/App.js @@ -18,6 +18,7 @@ import SportsActivitiesPage from "./components/SportsActivitiesPage"; import SportDetails from "./components/SportsDetails"; import GiftCard from "./components/GiftCard"; import PlaysPage from "./components/PlaysPage"; +import MoviePage from "./components/MoviePage"; function App() { @@ -41,6 +42,7 @@ function App() { /> } /> + } /> } /> } /> }/> diff --git a/src/components/MovieImageSlider.js b/src/components/MovieImageSlider.js new file mode 100644 index 0000000..244be46 --- /dev/null +++ b/src/components/MovieImageSlider.js @@ -0,0 +1,73 @@ +import React from 'react'; +import image3 from '../assets/images/download3.png'; +import Slider from 'react-slick'; +import 'slick-carousel/slick/slick.css'; +import 'slick-carousel/slick/slick-theme.css'; +import '../assets/styles/ImageSlider.css'; + +const ImageWithNoEffect = ({ imageSrc, altText }) => { + return ( +
+ {altText} +
+ ); +}; + +const MovieImageSlider = () => { + const settings = { + dots: true, + infinite: true, + speed: 500, + slidesToShow: 1, + centerMode: true, + centerPadding: '10%', + slidesToScroll: 1, + autoplay: true, + autoplaySpeed: 3000, + arrows: true, + prevArrow: , + nextArrow: , + }; + + return ( +
+ +
+ +
+
+ +
+
+ +
+
+
+ ); +}; + +const CustomPrevArrow = ({ onClick }) => { + return ( +
+ ◀ +
+ ); +}; + +const CustomNextArrow = ({ onClick }) => { + return ( +
+ ▶ +
+ ); +}; + +export default MovieImageSlider; diff --git a/src/components/MoviePage.js b/src/components/MoviePage.js new file mode 100644 index 0000000..eadc02d --- /dev/null +++ b/src/components/MoviePage.js @@ -0,0 +1,114 @@ +import React, { useEffect, useState } from 'react' +import Header from './Header' +import Chatbot from '../chatbot' +import Heading from './heading' +import Loader from './Loader' +import Footer from './Footer' +import MovieImageSlider from './MovieImageSlider' +import Movie from './Movie'; +import '../assets/styles/MovieList.css'; + +import poster1 from '../assets/images/poster1.jpg'; +import poster2 from '../assets/images/poster2.jpg'; +import poster3 from '../assets/images/poster3.jpg'; +import poster4 from '../assets/images/poster4.jpg'; +import poster5 from '../assets/images/poster5.jpg'; + +function MovieList({ searchTerm }) { + const movies = [ + { + id: 1, + poster: poster1, + title: 'Hindustani 2', + description: 'A gripping action-drama with thrilling moments.', + rating: 5.7, + votes: '3.9K', + genre: 'Action/Drama/Thriller' + }, + { + id: 2, + poster: poster2, + title: 'Kalki 2898 AD', + description: 'A sci-fi thriller set in the future.', + rating: 8.7, + votes: '630.2K', + genre: 'Action/Sci-Fi/Thriller' + }, + { + id: 3, + poster: poster3, + title: 'Deadpool & Wolverine', + description: 'Action-packed adventure with comedic twists.', + rating: 8.9, + votes: '268.9K', + genre: 'Action/Adventure/Comedy' + }, + { + id: 4, + poster: poster4, + title: 'Sarfira', + description: 'A biographical drama of a brave soul.', + rating: 8.9, + votes: '7.5K', + genre: 'Biography/Drama' + }, + { + id: 5, + poster: poster5, + title: 'Kill', + description: 'An intense action-thriller that keeps you on edge.', + rating: 9.0, + votes: '24.7K', + genre: 'Action/Thriller' + }, + ]; + + const filteredMovies = movies.filter(movie => + movie.title.toLowerCase().includes(searchTerm.toLowerCase()) + ); + + return ( + +
+ {filteredMovies.map((movie, index) => ( + + ))} +
+ ); +} + +const MoviePage = () => { + const [loading, setLoading] = useState(true); + const [searchTerm, setSearchTerm] = useState(""); + + useEffect(() => { + const timer = setTimeout(() => { + setLoading(false); + }, 2000); + return () => clearTimeout(timer); + }, []); + + if (loading) { + return ; + } + return ( +
+
+ + + + +
+ ) +} + +export default MoviePage \ No newline at end of file