Overview
The movie catalog is the heart of ReactFlix, providing users with a comprehensive, visually appealing grid of available movies. The catalog displays movie posters, key information, and quick access to trailers and detailed information.How It Works
The catalog page is built using a modular component architecture that separates concerns between data management, filtering, and presentation.Core Components
PeliculasPage
Main container that orchestrates the catalog view, search, and filters
PeliculaGrid
Responsive grid layout that displays movie cards
PeliculaCard
Individual movie card with poster, metadata, and actions
usePeliculaSearch
Custom hook managing search and filter logic
Movie Data Structure
Each movie in the catalog contains comprehensive metadata:The movie data is currently sourced from
mockPeliculas.js, providing 8 sample movies. This can be easily replaced with an API endpoint in production.Page Layout
The catalog page follows a clean, user-friendly layout:Movie Cards
Each movie card is interactive and information-rich:Visual Elements
- Movie Poster: High-quality image with fallback for broken links
- Overlay Controls: Appears on hover with trailer button
- Rating Badge: Displays IMDb-style rating (out of 10)
- Duration & Year: Quick metadata display
Interactive Features
Watch Trailer
Click the overlay button to watch the movie trailer in a modal
View Details
Navigate to the full detail page for complete information
Card Implementation
ThePeliculaCard component handles image errors gracefully and provides intuitive controls:
Loading States
The catalog provides visual feedback during data loading:The loading state includes a 300ms debounce to prevent flickering during fast searches.
Trailer Modal
When users click to watch a trailer, a full-screen modal appears with an embedded YouTube player:Features
- Keyboard Support: Press ESC to close the modal
- Click Outside: Click the backdrop to dismiss
- Body Scroll Lock: Prevents scrolling while modal is open
- Responsive Video: Embedded iframe scales to screen size
User Experience
Browsing Flow
- Landing: Users arrive at the catalog and see all available movies
- Exploration: Hover over cards to reveal trailer buttons
- Quick Preview: Click “Ver Tráiler” to watch without leaving the page
- Deep Dive: Click “Ver detalles” to view full movie information
Responsive Design
The movie grid automatically adjusts based on screen size:- Desktop: 4 columns of movie cards
- Tablet: 2-3 columns with adjusted card sizes
- Mobile: Single column, full-width cards
Performance Considerations
- Image Loading: Cards handle broken images with graceful fallbacks
- Debounced Search: 300ms delay prevents excessive filtering
- Memoization:
usePeliculaSearchefficiently manages state updates - Key Props: Proper key usage ensures efficient React rendering
Next Steps
Search & Filter
Learn how users can narrow down the catalog
Movie Details
Explore the detailed movie information page