Skip to content

Commit

Permalink
#2395 delete wp buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaryan1203 committed May 18, 2024
1 parent df6df61 commit cd62e5a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 80 deletions.
30 changes: 11 additions & 19 deletions src/frontend/src/pages/GanttPage/GanttChart.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Box, Chip, IconButton, Typography, useTheme } from '@mui/material';
import { Box, Button, Chip, IconButton, Typography, useTheme } from '@mui/material';
import { EventChange, GanttTask, RequestEventChange } from '../../utils/gantt.utils';
import { Edit } from '@mui/icons-material';
import GanttChartSection from './GanttChartSection';
import GanttChartCreateButtons from './GanttChartComponents/GanttChartCreateButtons';
import { useEffect, useState } from 'react';
import { NERButton } from '../../components/NERButton';
import { useHistory } from 'react-router-dom';
import { routes } from '../../utils/routes';

interface GanttChartProps {
startDate: Date;
Expand Down Expand Up @@ -31,24 +32,16 @@ const GanttChart = ({
highlightedChange
}: GanttChartProps) => {
const theme = useTheme();
const [allTasks, setAllTasks] = useState<GanttTask[]>([]);

useEffect(() => {
const tasks: GanttTask[] = [];
teamsList.forEach((teamName) => {
const currentTasks = teamNameToGanttTasksMap.get(teamName);
if (currentTasks) {
tasks.push(...currentTasks);
}
});

setAllTasks(tasks);
}, [teamNameToGanttTasksMap, teamsList]);
const history = useHistory();

return (
<>
<GanttChartCreateButtons tasks={allTasks} />
<Box sx={{marginTop: '2em'}}>
<Box sx={{ mt: '1em', position: 'fixed', right: '2%' }}>
<NERButton variant="contained" onClick={() => history.push(routes.PROJECTS_NEW)}>
Create Project
</NERButton>
</Box>
<Box sx={{ marginTop: '2em' }}>
{teamsList.map((teamName: string) => {
const tasks = teamNameToGanttTasksMap.get(teamName);

Expand Down Expand Up @@ -80,7 +73,6 @@ const GanttChart = ({
tasks.forEach((task) => {
task.children.sort((a, b) => a.start.getTime() - b.start.getTime());
});

return (
<Box
sx={{
Expand Down

This file was deleted.

0 comments on commit cd62e5a

Please sign in to comment.