Commit da5b1334 authored by Ermolaev Timur's avatar Ermolaev Timur

#54 Небольшие изменения

parent 213b15cc
...@@ -174,6 +174,7 @@ const CalendarRowDay = ({xs, hoursInDay, createTaskInCellHandler, currentTask, h ...@@ -174,6 +174,7 @@ const CalendarRowDay = ({xs, hoursInDay, createTaskInCellHandler, currentTask, h
hour={parseInt(hours[index])} hour={parseInt(hours[index])}
line={day.dayNumber} line={day.dayNumber}
task={box.task} task={box.task}
hourFormat={hourFormat}
setCurrentTask={setCurrentTask} setCurrentTask={setCurrentTask}
handleOpen={handleOpen} handleOpen={handleOpen}
increaseTaskHandler={increaseTaskHandler} increaseTaskHandler={increaseTaskHandler}
......
...@@ -13,7 +13,7 @@ const arrowClass = { ...@@ -13,7 +13,7 @@ const arrowClass = {
} }
} }
const CalendarTask = ({setCurrentTask, handleOpen, task, line, setCurrentLine, increaseTaskHandler, reduceTaskHandler}) => { const CalendarTask = ({setCurrentTask, handleOpen, task, line, setCurrentLine, increaseTaskHandler, reduceTaskHandler, hourFormat}) => {
const [color, setColor] = useState('') const [color, setColor] = useState('')
useEffect(() => { useEffect(() => {
...@@ -52,6 +52,26 @@ const CalendarTask = ({setCurrentTask, handleOpen, task, line, setCurrentLine, i ...@@ -52,6 +52,26 @@ const CalendarTask = ({setCurrentTask, handleOpen, task, line, setCurrentLine, i
sx={{ position: 'relative', height: '30px', backgroundColor: color, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', borderRadius: '10px', margin: '5px 10px', display: 'flex', justifyContent: 'flex-start', alignItems: 'center', paddingLeft: '5px', zIndex: '5', justifyContent: 'space-between'}} sx={{ position: 'relative', height: '30px', backgroundColor: color, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', borderRadius: '10px', margin: '5px 10px', display: 'flex', justifyContent: 'flex-start', alignItems: 'center', paddingLeft: '5px', zIndex: '5', justifyContent: 'space-between'}}
onClick={(e)=>{onClickTaskHandler(e, task)}} onClick={(e)=>{onClickTaskHandler(e, task)}}
> >
{task.infoForCell.endHour === task.infoForCell.startHour && hourFormat ?
<>
<div tyle={{display: 'flex', alignItems: 'center'}}>
<div style={{display: 'flex', alignItems: 'center'}}>
<ArrowBackIcon sx={arrowClass} onClick={(e)=>{e.stopPropagation(); increaseTaskHandler(line, task, true)}}/>
<ArrowForwardIcon sx={arrowClass} onClick={(e)=>{e.stopPropagation(); reduceTaskHandler(line, task, true)}}/>
<ArrowBackIcon sx={arrowClass} onClick={(e)=>{e.stopPropagation(); reduceTaskHandler(line, task, false)}}/>
<ArrowForwardIcon sx={arrowClass} onClick={(e)=>{e.stopPropagation(); increaseTaskHandler(line, task, false)}}/>
</div>
</div>
<div>
<span>
{task.title}
</span>
</div>
</>
:
<>
<div style={{display: 'flex', alignItems: 'center'}}> <div style={{display: 'flex', alignItems: 'center'}}>
<ArrowBackIcon sx={arrowClass} onClick={(e)=>{e.stopPropagation(); increaseTaskHandler(line, task, true)}}/> <ArrowBackIcon sx={arrowClass} onClick={(e)=>{e.stopPropagation(); increaseTaskHandler(line, task, true)}}/>
<ArrowForwardIcon sx={arrowClass} onClick={(e)=>{e.stopPropagation(); reduceTaskHandler(line, task, true)}}/> <ArrowForwardIcon sx={arrowClass} onClick={(e)=>{e.stopPropagation(); reduceTaskHandler(line, task, true)}}/>
...@@ -63,6 +83,8 @@ const CalendarTask = ({setCurrentTask, handleOpen, task, line, setCurrentLine, i ...@@ -63,6 +83,8 @@ const CalendarTask = ({setCurrentTask, handleOpen, task, line, setCurrentLine, i
<ArrowBackIcon sx={arrowClass} onClick={(e)=>{e.stopPropagation(); reduceTaskHandler(line, task, false)}}/> <ArrowBackIcon sx={arrowClass} onClick={(e)=>{e.stopPropagation(); reduceTaskHandler(line, task, false)}}/>
<ArrowForwardIcon sx={arrowClass} onClick={(e)=>{e.stopPropagation(); increaseTaskHandler(line, task, false)}}/> <ArrowForwardIcon sx={arrowClass} onClick={(e)=>{e.stopPropagation(); increaseTaskHandler(line, task, false)}}/>
</div> </div>
</>
}
</Grid> </Grid>
</>) </>)
}; };
......
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