This pull request introduces several key components and functionalities for the project. It includes the implementation of a responsive navigation bar (Navbar), a sidebar menu (Sidebar), and several dropdown components. Additionally, it integrates dark mode functionality and fetches genre data from an API to populate navigation links.
Changes Made
Components Added:
Navbar Component:
Implements a responsive navigation bar with a logo, navigation links, a search icon, and a dark mode toggle.
Includes a ProfileDropdown for user-related actions and a sidebar toggle button.
Integrates with the useDarkMode hook to handle dark mode toggling.
Sidebar Component:
Provides a side menu that slides in and out based on user interaction.
Includes a list of navigational links and dropdown items that can be expanded or collapsed.
The sidebar is responsive and appears only when toggled open.
LinkDropdown Component:
A dropdown menu for navigation links with hover and click functionalities.
Displays a list of items with the ability to show more or less items based on user interaction.
Integrates with the Link component from Next.js for client-side navigation.
ProfileDropdown Component:
A user profile dropdown menu that displays user actions like profile view, discussions, lists, ratings, watchlist, and settings.
Includes an arrow indicator and responsive design for better usability.
Custom Hooks:
useDarkMode Hook:
Manages dark mode state and applies the dark mode class to the document.
Provides a toggle function to switch between dark and light modes.
API Integration:
fetchGenres Function:
Fetches movie genres from the TMDB API and returns a list of genre names.
This data is used to populate the dropdown items in the Navbar component.
Environmental Configuration:
Added an .env.local file with the TMDB API key for secure API access.
Styling and Layout:
Applied Tailwind CSS classes to achieve a modern, responsive design for the navigation bar, sidebar, and dropdown menus.
Ensured that all new components are styled consistently and adapt to different screen sizes.
Files Modified
src/app/layout.js
src/app/page.js
src/components/Navbar.js
src/components/Sidebar.js
src/components/LinkDropdown.js
src/components/ProfileDropdown.js
src/hooks/useDarkMode.js
src/services/fetchGenres.js
.env.local
src/images/logo.svg
Testing
Verified responsiveness and functionality of the Navbar and Sidebar components.
Ensured that the dark mode toggle works as expected.
Tested the dropdown components for correct display and interaction.
Confirmed that genre data is fetched correctly and displayed in the Navbar.
Additional Notes
The sidebar functionality is dependent on the screen size and is hidden on larger screens, where the Navbar is displayed instead.
Make sure to configure the environment variables in your local setup to include the TMDB API key.
Pull Request Description
Summary
This pull request introduces several key components and functionalities for the project. It includes the implementation of a responsive navigation bar (
Navbar
), a sidebar menu (Sidebar
), and several dropdown components. Additionally, it integrates dark mode functionality and fetches genre data from an API to populate navigation links.Changes Made
Components Added:
Navbar
Component:ProfileDropdown
for user-related actions and a sidebar toggle button.useDarkMode
hook to handle dark mode toggling.Sidebar
Component:LinkDropdown
Component:Link
component from Next.js for client-side navigation.ProfileDropdown
Component:Custom Hooks:
useDarkMode
Hook:API Integration:
fetchGenres
Function:Navbar
component.Environmental Configuration:
.env.local
file with the TMDB API key for secure API access.Styling and Layout:
Files Modified
src/app/layout.js
src/app/page.js
src/components/Navbar.js
src/components/Sidebar.js
src/components/LinkDropdown.js
src/components/ProfileDropdown.js
src/hooks/useDarkMode.js
src/services/fetchGenres.js
.env.local
src/images/logo.svg
Testing
Navbar
andSidebar
components.Navbar
.Additional Notes
Navbar
is displayed instead.