Created the PowerItem.jsx
This commit is contained in:
parent
131abe16e9
commit
1a4bb50f3e
@ -0,0 +1,15 @@
|
||||
import "./styles.sass";
|
||||
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
|
||||
import {useLocation, useNavigate} from "react-router-dom";
|
||||
|
||||
export const PowerItem = ({icon, name, path}) => {
|
||||
const location = useLocation();
|
||||
const navigate = useNavigate();
|
||||
|
||||
return (
|
||||
<div className={"power-item" + (location.pathname === path ? " power-item-active" : "")} onClick={() => navigate(path)}>
|
||||
<FontAwesomeIcon icon={icon}/>
|
||||
<h2>{name}</h2>
|
||||
</div>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user