import React from "react"; import { useDispatch, useSelector } from "react-redux"; import { modalActions } from "../../../store/modalSlice"; import { sidebarActions } from "../../../store/sidebarSlice"; import IconWrapper from "../../globals/IconWrapper"; import Modal from "../../globals/Modal"; import ModalChild from "../../globals/ModalChild"; import ThemeToggler from "./ThemeToggler"; function Menu() { const dispatch = useDispatch(); const menuActive = useSelector((state) => state.modalReducer.type === "menu"); return ( <> { dispatch( modalActions.openModal({ type: "menu", positions: { left: 12, top: 50 }, }) ); }} active={menuActive} > {/* Contacts */} { dispatch(modalActions.closeModal()); dispatch( sidebarActions.changeActivePage({ newActivePage: "contacts" }) ); }} > Contacts { dispatch(modalActions.closeModal()); dispatch( sidebarActions.changeActivePage({ newActivePage: "settings" }) ); }} > Settings { event.target.querySelector("div").click(); }} >
Dark Mode
); } export default Menu;