diff --git a/frontend/src/components/common/Header.jsx b/frontend/src/components/common/Header.jsx
index e9fec39..2c9b208 100644
--- a/frontend/src/components/common/Header.jsx
+++ b/frontend/src/components/common/Header.jsx
@@ -44,6 +44,10 @@ const Header = () => {
};
}, [isSticky, isScrolled]);
+ useEffect(() => {
+ console.log(showDropdown);
+ }, [showDropdown]);
+
const updatestatus = () => {
httpClient.put("/doc_status", { email: localStorage.getItem("email") });
userLogout();
@@ -67,7 +71,9 @@ const Header = () => {
const dropdownRef = useRef();
const sidebarRef = useRef();
- useOutsideClose(dropdownRef, () => setShowDropdown(false));
+ useOutsideClose(dropdownRef, () => {
+ setShowDropdown(false);
+ });
useOutsideClose(sidebarRef, () => setSideBarOpen(false));
const handleLoginClick = () => {
@@ -85,21 +91,11 @@ const Header = () => {
{localStorage.getItem("username") &&
localStorage.getItem("username") !== "undefined" &&
localStorage.getItem("usertype") === "patient" && (
- // contact-header
- // flex justify-between items-center border-b-[1px] border-blue-8 h-full transition-all duration-300 ease-out max-[950px]:py-4 max-[950px]:px-8 max-xs:p-4 ${isScrolled ? "hidden opacity-0 py-0 h-0" : "visible opacity-100 py-4 px-40"}
- // hidden md:flex justify-between items-center px-4 lg:px-40 py-4 border-b border-blue-800
- // transition-all duration-300 ${isScrolled ? 'h-0 opacity-0 invisible p-0' : 'h-full opacity-100 visible'}
- // className={`flex justify-between items-center py-4 px-40 C h-full max-[950px]:px-8 max-[950px]:py-4 max-xs:p-4 ${
- // isScrolled
- // ? ""
- // : ""
- // }`}
- {/* details */}
{
: "translate-x-0 opacity-100"
}`}
>
- {/* contact-detail */}
- {/* icon */}
- {/* detail */}
telmedsphere489@gmail.com
- {/* contact-detail */}
{
: "translate-x-0 opacity-100"
}`}
>
- {/* appt-link */}
{
)}
- {/* relative top-0 left-0 z-[999] bg-[#d4ddf1] w-full text-blue-8 py-6 px-8 pt-6 pb-6 transition-colors duration-200 ease-linear */}
{
} `}
>
- {/* navbar */}
- {/* nav_logo */}
{
{!localStorage.getItem("username") && (
<>
- {/* auth-buttons */}
- {/* get_started_btn */}
*/}
-
- navigate("/buy-medicines")} className="cursor-pointer font-bold relative">
+ navigate("/buy-medicines")}
+ className="cursor-pointer font-bold relative"
+ >
MEDICINES
- 20% off
+
+ 20% off
+
-
-
setShowDropdown(!showDropdown)}>
+ {/* Account Dropdown */}
+
+
setShowDropdown(!showDropdown)}
+ >
ACCOUNT
-
-
- Hello!{" "}
- {localStorage.getItem("username") !== undefined && (
- {localStorage.getItem("username")}
- )}
-
-
Have a great health!!
-
-
-
-
- -
-
- setShowDropdown(false)}
- >
- My Wallet
-
-
- -
-
- setShowDropdown(false)}
+ {showDropdown && (
+
+
+
+
+ Hello!
+
+ {localStorage.getItem("username")}
+
+
+ Have a great health!!
+
+
+
-
+ Logout
+
+
+
+ -
+
+ setShowDropdown(false)}
+ >
+ My Wallet
+
+
+ -
+
+ setShowDropdown(false)}
+ >
+ My Cart
+
+
+ {cartItems.length}
+
+
+ -
+
+ setShowDropdown(false)}
+ >
+ My Orders
+
+
+
+
+
+ )}
+
) : (
-