Skip to content

Commit

Permalink
Merge pull request #36 from Aman-Mandal/notification-modal
Browse files Browse the repository at this point in the history
made notification-modal and added to navbar
  • Loading branch information
Aadarsh805 authored Oct 5, 2022
2 parents 5dda011 + 937e30a commit 71004a0
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions components/Navbar/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import NotificationsIcon from "@mui/icons-material/Notifications";
import SettingsIcon from "@mui/icons-material/Settings";
import { useStateContext } from "../../contexts/ContextProvider";
import MenuIcon from "@mui/icons-material/Menu";
import NotificationModal from "../NotificationModal/NotificationModal";

const NavButton = ({ title, icon, func }) => {
return (
Expand All @@ -29,8 +30,14 @@ const NavButton = ({ title, icon, func }) => {
};

const Navbar = () => {
const { activeMenu, setActiveMenu, screenSize, setScreenSize } =
useStateContext();
const {
activeMenu,
setActiveMenu,
screenSize,
setScreenSize,
isClicked,
handleClick,
} = useStateContext();

useEffect(() => {
const handleResize = () => setScreenSize(window.innerWidth);
Expand Down Expand Up @@ -95,7 +102,7 @@ const Navbar = () => {
<NavButton
icon={<NotificationsIcon />}
title={"Notifications"}
func={() => {}}
func={() => handleClick("notification")}
/>
<NavButton icon={<SettingsIcon />} title={"Settings"} func={() => {}} />

Expand All @@ -111,6 +118,8 @@ const Navbar = () => {
</span>
</div>
</Tooltip>

{isClicked.notification && <NotificationModal />}
</div>
</div>
);
Expand Down

0 comments on commit 71004a0

Please sign in to comment.