This PR introduces a new "Trending" section to the application, displaying trending movies fetched from the TMDB API. Users can toggle between viewing "Today" and "This Week" trending movies using a toggle switch. The section updates dynamically when the user switches between the two options.
Key Features:
API Integration: Integrated TMDB API to fetch trending movies based on the selected timeframe (day or week).
Toggle Switch: Users can toggle between "Today" and "This Week" trending movies, with movies dynamically re-fetched and displayed accordingly.
Trending Section UI: A responsive section that displays movie cards in a horizontal slider format, allowing users to scroll through trending movies.
Reusability: Components such as ToggleSwitch, MediaCard, and HorizontalSlider were created to make the section modular and easy to maintain.
Error Handling: Proper error handling and loading states have been implemented to ensure smooth user experience even in case of API fetch failures.
Components:
TrendingSection: Main component to display the trending section with toggle functionality.
ToggleSwitch: Reusable toggle switch to switch between "Today" and "This Week" options.
MediaCard: Reusable movie card component that displays movie information including image, title, vote average, and release date.
HorizontalSlider: Horizontal scrolling container for movie cards, with background styling and smooth scroll behavior.
Testing:
Verified that the movies are fetched correctly based on the selected timeframe ,tested that the UI remains responsive on different screen sizes.
Ensured smooth toggle functionality and horizontal scrolling behavior.
Design and Implement Trending Section
Overview:
This PR introduces a new "Trending" section to the application, displaying trending movies fetched from the TMDB API. Users can toggle between viewing "Today" and "This Week" trending movies using a toggle switch. The section updates dynamically when the user switches between the two options.
Key Features:
Components:
Testing: