Commit 2fc36f54 authored by Ermolaev Timur's avatar Ermolaev Timur

#38 небольшие правки

parent 0c94e313
...@@ -13,6 +13,6 @@ const CalendarRow = ({children}) => { ...@@ -13,6 +13,6 @@ const CalendarRow = ({children}) => {
</> </>
}; };
export default memo(CalendarRow); export default CalendarRow;
import { Tune } from "@mui/icons-material";
import { Grid } from "@mui/material"; import { Grid } from "@mui/material";
import { memo, useMemo } from "react"; import { memo, useMemo } from "react";
import CalendarStandartCell from "../CalendarStandartCell.js/CalendarStandartCell"; import CalendarStandartCell from "../CalendarStandartCell.js/CalendarStandartCell";
...@@ -95,7 +94,7 @@ const CalendarRowDay = ({xs, hoursInDay, createTaskInCellHandler, currentTask, h ...@@ -95,7 +94,7 @@ const CalendarRowDay = ({xs, hoursInDay, createTaskInCellHandler, currentTask, h
} }
return lines return lines
}, [sortedTasks, hours]) }, [sortedTasks, hours])
console.log(linesInDay)
return <> return <>
<Grid <Grid
container container
...@@ -119,15 +118,12 @@ const CalendarRowDay = ({xs, hoursInDay, createTaskInCellHandler, currentTask, h ...@@ -119,15 +118,12 @@ const CalendarRowDay = ({xs, hoursInDay, createTaskInCellHandler, currentTask, h
dayNumber={day.dayNumber} dayNumber={day.dayNumber}
currentTask={currentTask} currentTask={currentTask}
handleOpen={handleOpen} handleOpen={handleOpen}
modal={modal.open} modal={modal}
> >
<CalendarTask <CalendarTask
setCurrentTask={setCurrentTask} setCurrentTask={setCurrentTask}
year={year}
month={month}
tasks={tasks}
day={day}
hours={hour} hours={hour}
modal={modal}
hourFormat={hourFormat} hourFormat={hourFormat}
handleOpen={handleOpen} handleOpen={handleOpen}
currentTask={currentTask} currentTask={currentTask}
...@@ -141,4 +137,4 @@ const CalendarRowDay = ({xs, hoursInDay, createTaskInCellHandler, currentTask, h ...@@ -141,4 +137,4 @@ const CalendarRowDay = ({xs, hoursInDay, createTaskInCellHandler, currentTask, h
</> </>
}; };
export default CalendarRowDay; export default memo(CalendarRowDay);
\ No newline at end of file \ No newline at end of file
...@@ -15,9 +15,9 @@ const CalendarStandartCell = ({children, xs, hours, dayNumber, createTaskInCell ...@@ -15,9 +15,9 @@ const CalendarStandartCell = ({children, xs, hours, dayNumber, createTaskInCell
onClick={(e)=>{createTaskInCellHandler(dayNumber, hours); setIsThisCell(true); handleOpen(e)}}> onClick={(e)=>{createTaskInCellHandler(dayNumber, hours); setIsThisCell(true); handleOpen(e)}}>
{children} {children}
{isThisCell ? {isThisCell ?
<Grid <Grid
sx={{backgroundColor: 'lightgreen', padding: '10px', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis'}} sx={{height: '30px', backgroundColor: 'lightgreen', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', padding: '5px', margin:"5px 10px", borderRadius: '10px'}}
> >
<span> <span>
Задача Задача
</span> </span>
......
...@@ -6,7 +6,7 @@ import { editCalendarTask } from "../../../store/actions/tasksActions"; ...@@ -6,7 +6,7 @@ import { editCalendarTask } from "../../../store/actions/tasksActions";
const TaskDefault = ({task, onClickTaskHandler}) => { const TaskDefault = ({task, onClickTaskHandler}) => {
return(<Grid return(<Grid
sx={{ height: '30px', backgroundColor: 'lightgreen', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', padding: '5px', borderBottom: '1px solid rgb(29, 161, 51)', borderRadius: '10px', margin: '5px 10px'}} sx={{ height: '30px', backgroundColor: 'lightgreen', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', padding: '5px', borderBottom: '1px solid rgb(29, 161, 51)', borderRadius: '10px', margin: '5px 10px', textAlign: 'left'}}
onClick={onClickTaskHandler} onClick={onClickTaskHandler}
> >
<span> <span>
...@@ -17,7 +17,7 @@ const TaskDefault = ({task, onClickTaskHandler}) => { ...@@ -17,7 +17,7 @@ const TaskDefault = ({task, onClickTaskHandler}) => {
const TaskWithNoStartAndAllEnd = ({task, onClickTaskHandler}) => { const TaskWithNoStartAndAllEnd = ({task, onClickTaskHandler}) => {
return(<Grid return(<Grid
sx={{height: '30px', backgroundColor: 'lightgreen', whiteSpace: 'nowrap', padding: '5px', borderBottom: '1px solid rgb(29, 161, 51)', borderTopLeftRadius: '10px', borderBottomLeftRadius: '10px', margin:"5px -1px 5px 10px", position:'relative'}} sx={{height: '30px', backgroundColor: 'lightgreen', whiteSpace: 'nowrap', padding: '5px', borderBottom: '1px solid rgb(29, 161, 51)', borderTopLeftRadius: '10px', borderBottomLeftRadius: '10px', margin:"5px -1px 5px 10px", position:'relative', textAlign: 'left'}}
onClick={onClickTaskHandler} onClick={onClickTaskHandler}
> >
<span> <span>
...@@ -59,14 +59,11 @@ const Empty = ({}) => { ...@@ -59,14 +59,11 @@ const Empty = ({}) => {
const CalendarTask = ({year, month, tasks, day, hours, setCurrentTask, hourFormat, handleOpen, currentTask, linesForCell, sortedTasks}) => { const CalendarTask = ({hours, setCurrentTask, hourFormat, handleOpen, currentTask, linesForCell, sortedTasks}) => {
const [thisCellCurrentTask, setThisCellCurrentTask] = useState({}) const [thisCellCurrentTask, setThisCellCurrentTask] = useState({})
const hour = parseInt(hours.split(':')[0]) const hour = parseInt(hours.split(':')[0])
const tasksCell = useMemo(() => {
return []
}, [])
useEffect(()=>{ useEffect(()=>{
if (!currentTask.title) { if (!currentTask.title) {
...@@ -120,6 +117,7 @@ const CalendarTask = ({year, month, tasks, day, hours, setCurrentTask, hourForma ...@@ -120,6 +117,7 @@ const CalendarTask = ({year, month, tasks, day, hours, setCurrentTask, hourForma
} else { } else {
return ( return (
<Empty <Empty
/> />
) )
} }
......
...@@ -114,7 +114,7 @@ function MonthCalendar() { ...@@ -114,7 +114,7 @@ function MonthCalendar() {
description:"описание", description:"описание",
priority: null, priority: null,
dateTimeStart: dateToISOLikeButLocal(new Date(dateNow.year, dateNow.month, dayNumber, hour, 0)), dateTimeStart: dateToISOLikeButLocal(new Date(dateNow.year, dateNow.month, dayNumber, hour, 0)),
dateTimeDue: dateToISOLikeButLocal(new Date(dateNow.year, dateNow.month, dayNumber, hourDue + 4, 59)), dateTimeDue: dateToISOLikeButLocal(new Date(dateNow.year, dateNow.month, dayNumber, hourDue, 59)),
} }
setCurrentTask((newTask)) setCurrentTask((newTask))
} }
......
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