Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

made notification-modal and added to navbar #36

Merged
merged 1 commit into from
Oct 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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