import React, { useContext } from "react"; import { useSelector } from "react-redux"; import { Link } from "react-router-dom"; import bank1 from "../../assets/images/bank-1.png"; import bank2 from "../../assets/images/bank-2.png"; import bank3 from "../../assets/images/bank-3.png"; import bank4 from "../../assets/images/bank-4.png"; import profileImg from "../../assets/images/profile-pic.jpg"; import useToggle from "../../hooks/useToggle"; import DarkModeContext from "../Contexts/DarkModeContext"; import Icons from "../Helpers/Icons"; import ModalCom from "../Helpers/ModalCom"; import SearchCom from "../Helpers/SearchCom"; export default function Header({ logoutModalHandler, sidebarHandler }) { const { userInfo } = useSelector((state) => state.userInfo); const [balanceDropdown, setbalanceValue] = useToggle(false); const [notificationDropdown, setNotificationValue] = useToggle(false); const [userProfileDropdown, setProfileDropdown] = useToggle(false); const [moneyPopup, setPopup] = useToggle(false); const darkMode = useContext(DarkModeContext); const handlerBalance = () => { setbalanceValue.toggle(); if (notificationDropdown) { setNotificationValue.toggle(); } if (userProfileDropdown) { setProfileDropdown.toggle(); } }; const handlerNotification = () => { setNotificationValue.toggle(); if (balanceDropdown) { setbalanceValue.toggle(); } if (userProfileDropdown) { setProfileDropdown.toggle(); } }; const handlerProfile = () => { setProfileDropdown.toggle(); if (balanceDropdown) { setbalanceValue.toggle(); } if (notificationDropdown) { setNotificationValue.toggle(); } }; const clickAwayhandler = () => { if (balanceDropdown) { setbalanceValue.toggle(); } if (notificationDropdown) { setNotificationValue.toggle(); } if (userProfileDropdown) { setProfileDropdown.toggle(); } }; const addMoneyHandler = () => { setPopup.toggle(); setbalanceValue.set(false); }; return ( <>
{/* search bar */}
{/**/}
{/* user info */}
{/* dark mode */} {/* balance */} {/* notification */}
handlerNotification()} className="lg:w-[48px] lg:h-[48px] w-[38px] h-[38px] bg-white flex justify-center items-center rounded-full overflow-hidden relative" > 10

Recent Notifications

  • Your Account has been created successfully done

    23 house ago

  • You upload your frast product successfully done

    23 house ago

  • Thank you ! you made your frast sell 232.98 ETH

    23 house ago

  • Your Account has been created successfully done

    23 house ago

  • Your Account has been created successfully done

    23 house ago

See all Notification
10
{/* profile */}
handlerProfile()} className="flex items-center space-x-3.5" > {/* profile-image */}
profile

{userInfo.firstname + ' ' + userInfo.lastname}

{/*

@broklinslam_75

*/}

My Profile

  • My Profile

  • History

  • Setting

  • Log Out

profile
{balanceDropdown || notificationDropdown || userProfileDropdown ? (
) : ( "" )} {moneyPopup && (

Connect to a wallet

  • MetaMask

  • Coinbase Wallet

  • Bitski

  • WalletConnect

View Wallet
)} ); }