Commit 732adcdf authored by Ermolaev Timur's avatar Ermolaev Timur

#157 Удалил проекты

parent 24ad2745
......@@ -8,7 +8,6 @@ import Register from './containers/Register/Register';
import MonthCalendar from './containers/MonthCalendar/MonthCalendar';
import ForgottenPassword from "./containers/ForgottenPassword/ForgottenPassword";
import Projects from "./containers/Projects/Projects";
import FullProject from "./containers/FullProject/FullProject";
import WeekCalendar from "./containers/WeekCalendar/WeekCalendar";
import UsersTasks from "./containers/UsersTasks/UsersTasks";
......@@ -44,14 +43,6 @@ const App = () => {
<Projects />
</ProtectedRoute>
} />
<Route path={"/projects/:id"} element={
<ProtectedRoute
isAllowed={user}
redirectUrl={"/sign-in"}
>
<FullProject />
</ProtectedRoute>
} />
<Route path={"/"} element={
<ProtectedRoute
isAllowed={user}
......
......@@ -2,7 +2,6 @@ import {Box, Typography } from "@mui/material";
import { useSelector } from "react-redux";
import { memo, useMemo } from "react";
import DeleteButton from "../../../../UI/DeleteButton/DeleteButton";
import ArrowIncrementButton from "../../../../UI/ArrowIncrementButton/ArrowIncrementButton";
const styleBlock = {
border: '2px solid black',
......@@ -19,7 +18,7 @@ const styleText = {
fontWeight: '600',
}
const ProjectItem = ({ title, members, onClickProjectHandler, onClickGoToSpecificProjectHandler, deleteProjectHandler }) => {
const ProjectItem = ({ title, members, onClickProjectHandler, deleteProjectHandler }) => {
const { user } = useSelector(state => state.users);
const currentRoleInProject = useMemo(() => {
......@@ -47,7 +46,6 @@ const ProjectItem = ({ title, members, onClickProjectHandler, onClickGoToSpecifi
</Box>
<Box>
{currentRoleInProject === 'Админ' ? <DeleteButton onClick={deleteProjectHandler}/> : null}
<ArrowIncrementButton onClick={onClickGoToSpecificProjectHandler}/>
</Box>
</Box>
</>
......
......@@ -4,7 +4,7 @@ import ProjectItem from "./ProjectItem/ProjectItem";
const style = {height: '79vh', overflow: 'auto', overflowX: 'hidden', display: 'flex', flexDirection: 'column', gap: '10px'}
const ProjectsList = ({projects, onClickProjectHandler, onClickGoToSpecificProjectHandler, deleteProjectHandler}) => {
const ProjectsList = ({projects, onClickProjectHandler, deleteProjectHandler}) => {
return (
<Box sx={style}>
{projects?.map(project => {
......@@ -13,7 +13,6 @@ const ProjectsList = ({projects, onClickProjectHandler, onClickGoToSpecificProje
members={project.members}
key={project.id}
onClickProjectHandler={()=>{onClickProjectHandler(project)}}
onClickGoToSpecificProjectHandler={(e)=>{onClickGoToSpecificProjectHandler(e, project.id)}}
deleteProjectHandler={(e)=>{deleteProjectHandler(e, project.id)}}
/>
})}
......
......@@ -10,7 +10,7 @@ const style = {
marginBottom: '10px',
}
const ProjectsWrapper = ({ onClickProjectHandler, projects, onClickGoToSpecificProjectHandler, handleOpen, deleteProjectHandler }) => {
const ProjectsWrapper = ({ onClickProjectHandler, projects, handleOpen, deleteProjectHandler }) => {
return <>
......@@ -23,7 +23,6 @@ const ProjectsWrapper = ({ onClickProjectHandler, projects, onClickGoToSpecificP
<ProjectsList
projects={projects}
onClickProjectHandler={onClickProjectHandler}
onClickGoToSpecificProjectHandler={onClickGoToSpecificProjectHandler}
deleteProjectHandler={deleteProjectHandler}
/>
</Grid>
......
......@@ -31,11 +31,6 @@ const Projects = () => {
setCurrentProject(project)
}, [])
const onClickGoToSpecificProjectHandler = useCallback((e, projectId) => {
e.stopPropagation();
navigate(`/projects/${projectId}`)
}, [navigate])
const createNewProjectHandler = useCallback(() => {
dispatch(createProject({ title: projectTitle, user: user.id }, navigate))
}, [dispatch, projectTitle, user.id, navigate])
......@@ -62,7 +57,6 @@ const Projects = () => {
<ProjectsWrapper
projects={projects}
onClickProjectHandler={onClickProjectHandler}
onClickGoToSpecificProjectHandler={onClickGoToSpecificProjectHandler}
handleOpen={handleOpen}
deleteProjectHandler={deleteProjectHandler}
/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment