The PowerItem.jsx now supports a middle click
This commit is contained in:
parent
b9d7062eba
commit
b482e1e8b7
@ -6,8 +6,16 @@ export const PowerItem = ({icon, name, path}) => {
|
|||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
const mouseDown = (event) => {
|
||||||
|
if (event.button === 1) {
|
||||||
|
event.preventDefault();
|
||||||
|
window.open(window.location.origin + path, "_blank");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={"power-item" + (location.pathname === path ? " power-item-active" : "")} onClick={() => navigate(path)}>
|
<div className={"power-item" + (location.pathname === path ? " power-item-active" : "")}
|
||||||
|
onMouseDown={mouseDown} onClick={() => navigate(path)}>
|
||||||
<FontAwesomeIcon icon={icon}/>
|
<FontAwesomeIcon icon={icon}/>
|
||||||
<h2>{name}</h2>
|
<h2>{name}</h2>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user