Anding routing fixing bugs

This commit is contained in:
MuhammadKhalilzadeh committed 2024-06-09 22:48:14 +03:30
1 parent 69c24223ab
commit 5c31e38b2d
4 files changed
+132 -526

No files matched your search

@@ -11,13 +11,9 @@ import { useNavigate } from "react-router-dom";
* @returns {React.ReactElement} The rendered menu button component.
*/
const DashboardMenuButton = (icon, title, to) => {
const [isActive, setIsActive] = useState(false);
const navigate = useNavigate();
const DashboardMenuButton = (icon, title, to, isActive, onClick) => {
const handleClick = () => {
setIsActive(!isActive);
navigate(to);
onClick();
};
return (