Update ProjectBox.jsx

This commit is contained in:
Mathias Wagner
2024-07-22 22:20:02 +02:00
parent 9782971ad6
commit 4c8415883a

View File

@ -3,11 +3,8 @@ import {ProjectContext} from "@/states/Dashboard/contexts/Project";
import {useContext} from "react";
import {useNavigate} from "react-router-dom";
export const ProjectBox = ({project}) => {
export const ProjectBox = ({project, style}) => {
const boxStyle = {cursor: "pointer", "&:hover": {backgroundColor: "#eee"},
"&:active": {backgroundColor: "#ddd", scale: "0.95"}, "&:focus": {outline: "none"},
transition: "all 0.1s ease-in-out", userSelect: "none"}
const {setCurrentProject} = useContext(ProjectContext);
const navigate = useNavigate();
@ -19,7 +16,7 @@ export const ProjectBox = ({project}) => {
return (
<Box justifyContent="center" alignItems="center" display="flex" borderRadius="10px"
border="1px solid #ccc" p={2.5} sx={boxStyle} onClick={switchProject}>
border="1px solid #ccc" p={2.5} sx={style} onClick={switchProject}>
<Avatar sx={{width: "50px", height: "50px", marginRight: "10px"}} variant="rounded">
{project.name.charAt(0).toUpperCase()}
</Avatar>