From c358c11a2bb7c89dd1d4fc028aa2b1ad377c75e8 Mon Sep 17 00:00:00 2001 From: Peace Oloruntoba <116691242+PeaceOloruntoba@users.noreply.github.com> Date: Wed, 21 Jun 2023 19:44:08 +0100 Subject: [PATCH 1/3] Update SubMenu.js I think this should solve the issue of transparent navbar, and also don't forget to adjust the text-red-500 to the desired color, maybe light green 'text-green-200' or something --- src/pages/components/Navbar/SubMenu.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/pages/components/Navbar/SubMenu.js b/src/pages/components/Navbar/SubMenu.js index 513a0c74..3b81eb87 100644 --- a/src/pages/components/Navbar/SubMenu.js +++ b/src/pages/components/Navbar/SubMenu.js @@ -30,6 +30,24 @@ const SubMenu = ({ isVisible, transparent }) => { useEffect(() => { changeLanguage(language); }, [language]); + // Check if the viewport matches a mobile screen width + const mediaQuery = window.matchMedia('(max-width: 767px)'); + const handleMediaQueryChange = (event) => { + setIsMobile(event.matches); + }; + + // Initial check + handleMediaQueryChange(mediaQuery); + + // Listen for changes in viewport width + mediaQuery.addEventListener('change', handleMediaQueryChange); + + // Clean up the event listener + return () => { + mediaQuery.removeEventListener('change', handleMediaQueryChange); + }; + }, []); + return (