diff --git a/13-stripe-submenus/final/src/Sidebar.js b/13-stripe-submenus/final/src/Sidebar.js index c5a2f16e1..ebad3f79b 100644 --- a/13-stripe-submenus/final/src/Sidebar.js +++ b/13-stripe-submenus/final/src/Sidebar.js @@ -1,32 +1,53 @@ +// Import React library for creating components import React from 'react' + +// Import FaTimes icon from react-icons library for the close button import { FaTimes } from 'react-icons/fa' + +// Import the custom hook to access global context import { useGlobalContext } from './context' + +// Import sublinks data import sublinks from './data' + +// Define the Sidebar component const Sidebar = () => { + // Destructure `isSidebarOpen` and `closeSidebar` from global context const { isSidebarOpen, closeSidebar } = useGlobalContext() + + // Return the JSX for the Sidebar return (