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

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

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