diff --git a/src/components/Navbar.jsx b/src/components/Navbar.jsx index 5a109d2..7680ad9 100644 --- a/src/components/Navbar.jsx +++ b/src/components/Navbar.jsx @@ -1,7 +1,6 @@ import React, { useState, useEffect, useRef } from "react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { - faChevronUp, faThLarge, faPaperPlane, faChartLine, @@ -10,6 +9,7 @@ import { faMoon, faFileAlt, faLightbulb, + faChevronDown, } from "@fortawesome/free-solid-svg-icons"; import { faFacebookF, @@ -20,7 +20,7 @@ import { faTiktok, } from "@fortawesome/free-brands-svg-icons"; import { Link } from "react-router-dom"; -import { Search } from "@mui/icons-material"; +import { Height, Search } from "@mui/icons-material"; // Dropdown item component const DropdownItem = ({ icon, title, description }) => ( @@ -50,6 +50,24 @@ const NavMenu = ({ isDarkMode, showSearchBar }) => { setIsChannelsDropdownOpen(!isChannelsDropdownOpen); setIsToolsDropdownOpen(false); // Close tools dropdown when channels dropdown opens }; + + // We Only Re-rotate icons back to original, when cursor leaves both button and dropdown + useEffect(() => { + if(isToolsDropdownOpen) { + document.getElementById('toolsIcon').classList.add('rotate-[180deg]') + } + else { + document.getElementById('toolsIcon').classList.remove('rotate-[180deg]') + } + + if(isChannelsDropdownOpen) { + document.getElementById('channelIcon').classList.add('rotate-[180deg]') + } + else { + document.getElementById('channelIcon').classList.remove('rotate-[180deg]') + } + }, [isToolsDropdownOpen, isChannelsDropdownOpen]) + return ( <> @@ -170,13 +190,15 @@ const NavMenu = ({ isDarkMode, showSearchBar }) => {
@@ -200,7 +222,7 @@ const NavMenu = ({ isDarkMode, showSearchBar }) => {
{/* Other Links */} - + Settings {/* Get Started Button */}