Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
planner-team-one
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
21
Issues
21
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Евгений Положенцев
planner-team-one
Commits
5b44f9ae
Commit
5b44f9ae
authored
Dec 25, 2022
by
Ermolaev Timur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#131
Добавил ховер эффекты
parent
26d9e4ab
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
60 deletions
+16
-60
CalendarRowDay.js
...lendar/MonthCalendarBody/CalendarRowDay/CalendarRowDay.js
+1
-4
EmptyBox.js
...dar/MonthCalendarBody/CalendarRowDay/EmptyBox/EmptyBox.js
+0
-52
CalendarTask.js
...thCalendar/MonthCalendarBody/CalendarTask/CalendarTask.js
+7
-2
CalendarStandartCell.js
...Calendars/UI/CalendarStandartCell/CalendarStandartCell.js
+8
-2
No files found.
planner-front/src/components/Calendars/MonthCalendar/MonthCalendarBody/CalendarRowDay/CalendarRowDay.js
View file @
5b44f9ae
...
@@ -87,8 +87,5 @@ const CalendarRowDay = ({ xs, hoursInDay, createTaskInCellHandler, currentTask,
...
@@ -87,8 +87,5 @@ const CalendarRowDay = ({ xs, hoursInDay, createTaskInCellHandler, currentTask,
<
/
>
<
/
>
};
};
export
default
memo
(
CalendarRowDay
,
(
prevProps
,
nextProps
)
=>
{
export
default
memo
(
CalendarRowDay
);
if
(
!
prevProps
.
modal
)
return
false
if
(
nextProps
.
modal
)
return
true
});
planner-front/src/components/Calendars/MonthCalendar/MonthCalendarBody/CalendarRowDay/EmptyBox/EmptyBox.js
deleted
100644 → 0
View file @
26d9e4ab
import
{
Grid
}
from
"@mui/material"
;
import
React
,
{
memo
,
useEffect
,
useState
}
from
"react"
;
import
DefaultTask
from
"../../../../UI/DefaultTask/DefaultTask"
;
const
EmptyBox
=
({
hourNumber
,
handleOpen
,
dayNumber
,
xs
,
dragTaskHandler
,
modal
,
createTaskInCellHandler
,
copyTask
,
createCopyTask
})
=>
{
const
[
isThisCell
,
setIsThisCell
]
=
useState
(
false
)
useEffect
(()
=>
{
if
(
!
modal
)
{
setIsThisCell
(
false
);
}
},
[
modal
])
const
onClickHandler
=
(
e
,
dayNumber
,
hour
)
=>
{
if
(
copyTask
)
{
createCopyTask
(
dayNumber
,
hour
)
}
else
{
createTaskInCellHandler
(
dayNumber
,
hour
);
setIsThisCell
(
true
);
handleOpen
(
e
)
}
}
const
dragOverHandler
=
(
e
)
=>
{
e
.
preventDefault
();
}
const
dropHandler
=
(
e
)
=>
{
e
.
stopPropagation
()
e
.
preventDefault
();
dragTaskHandler
(
dayNumber
,
hourNumber
)
}
return
(
<
Grid
onDragOver
=
{(
e
)
=>
{
dragOverHandler
(
e
)
}}
onDrop
=
{(
e
)
=>
{
dropHandler
(
e
)
}}
onClick
=
{(
e
)
=>
{
onClickHandler
(
e
,
dayNumber
,
hourNumber
)
}}
className
=
'test_empty_box'
item
xs
=
{
xs
}
sx
=
{{
height
:
'40px'
,
backgroundColor
:
'rgb(0,0,0,0)'
,
zIndex
:
'6'
,
cursor
:
copyTask
?
'pointer'
:
'default'
}}
>
{
isThisCell
?
<
DefaultTask
/>
:
' '
}
<
/Grid>
)
};
export
default
memo
(
EmptyBox
,
(
prevProps
,
nextProps
)
=>
{
if
(
!
prevProps
.
modal
)
return
false
if
(
nextProps
.
modal
)
return
true
});
\ No newline at end of file
planner-front/src/components/Calendars/MonthCalendar/MonthCalendarBody/CalendarTask/CalendarTask.js
View file @
5b44f9ae
...
@@ -63,6 +63,11 @@ const CalendarTask = ({ setCurrentTask, handleOpen, task, line, setCopyTask, wid
...
@@ -63,6 +63,11 @@ const CalendarTask = ({ setCurrentTask, handleOpen, task, line, setCopyTask, wid
e
.
target
.
style
.
boxShadow
=
'none'
e
.
target
.
style
.
boxShadow
=
'none'
}
}
const
onClickCopyIconHandler
=
(
e
)
=>
{
e
.
stopPropagation
();
setCopyTask
(
task
)
}
return
(
<>
return
(
<>
<
Grid
<
Grid
...
@@ -76,7 +81,7 @@ const CalendarTask = ({ setCurrentTask, handleOpen, task, line, setCopyTask, wid
...
@@ -76,7 +81,7 @@ const CalendarTask = ({ setCurrentTask, handleOpen, task, line, setCopyTask, wid
<
span
style
=
{{
maxWidth
:
'60%'
,
whiteSpace
:
'nowrap'
,
overflow
:
'hidden'
,
textOverflow
:
'ellipsis'
}}
>
<
span
style
=
{{
maxWidth
:
'60%'
,
whiteSpace
:
'nowrap'
,
overflow
:
'hidden'
,
textOverflow
:
'ellipsis'
}}
>
{
task
.
title
}
{
task
.
title
}
<
/span
>
<
/span
>
<
ContentCopyIcon
sx
=
{{
width
:
'20px'
,
cursor
:
'pointer'
,
marginLeft
:
'auto'
}}
onClick
=
{(
e
)
=>
{
e
.
stopPropagation
();
setCopyTask
(
task
)
}}
>
<
ContentCopyIcon
sx
=
{{
width
:
'20px'
,
cursor
:
'pointer'
,
marginLeft
:
'auto'
}}
onClick
=
{(
e
)
=>
{
onClickCopyIconHandler
(
e
)
}}
>
<
/ContentCopyIcon
>
<
/ContentCopyIcon
>
...
...
planner-front/src/components/Calendars/UI/CalendarStandartCell/CalendarStandartCell.js
View file @
5b44f9ae
...
@@ -14,7 +14,7 @@ const CalendarStandartCell = ({ children, xs, hours, dayNumber, createTaskInCell
...
@@ -14,7 +14,7 @@ const CalendarStandartCell = ({ children, xs, hours, dayNumber, createTaskInCell
borderRight
:
'1px solid black'
,
borderRight
:
'1px solid black'
,
borderBottom
:
week
?
'1px solid black'
:
null
,
borderBottom
:
week
?
'1px solid black'
:
null
,
'&:hover'
:
{
'&:hover'
:
{
cursor
:
'pointer
'
,
cursor
:
children
?
null
:
'#d6d2d2
'
,
background
:
children
?
null
:
'#d6d2d2'
background
:
children
?
null
:
'#d6d2d2'
},
},
}
}
...
@@ -27,12 +27,17 @@ const CalendarStandartCell = ({ children, xs, hours, dayNumber, createTaskInCell
...
@@ -27,12 +27,17 @@ const CalendarStandartCell = ({ children, xs, hours, dayNumber, createTaskInCell
const
dragOverHandler
=
(
e
)
=>
{
const
dragOverHandler
=
(
e
)
=>
{
e
.
preventDefault
();
e
.
preventDefault
();
e
.
target
.
style
.
background
=
children
?
null
:
'#d6d2d2'
}
const
dragLeaveHandler
=
(
e
)
=>
{
e
.
preventDefault
();
e
.
target
.
style
.
background
=
null
}
}
const
dropHandler
=
(
e
)
=>
{
const
dropHandler
=
(
e
)
=>
{
e
.
stopPropagation
()
e
.
stopPropagation
()
e
.
preventDefault
();
e
.
preventDefault
();
console
.
log
(
dayNumber
,
parseInt
(
hours
.
split
(
':'
)[
0
]))
e
.
target
.
style
.
background
=
null
dragTaskHandler
(
dayNumber
,
parseInt
(
hours
.
split
(
':'
)[
0
]),
month
,
year
)
dragTaskHandler
(
dayNumber
,
parseInt
(
hours
.
split
(
':'
)[
0
]),
month
,
year
)
}
}
...
@@ -52,6 +57,7 @@ const CalendarStandartCell = ({ children, xs, hours, dayNumber, createTaskInCell
...
@@ -52,6 +57,7 @@ const CalendarStandartCell = ({ children, xs, hours, dayNumber, createTaskInCell
sx
=
{
cellClass
}
sx
=
{
cellClass
}
onClick
=
{(
e
)
=>
{
onClickHandler
(
e
)
}}
onClick
=
{(
e
)
=>
{
onClickHandler
(
e
)
}}
onDragOver
=
{(
e
)
=>
{
dragOverHandler
(
e
)
}}
onDragOver
=
{(
e
)
=>
{
dragOverHandler
(
e
)
}}
onDragLeave
=
{(
e
)
=>
{
dragLeaveHandler
(
e
)}}
onDrop
=
{(
e
)
=>
{
dropHandler
(
e
)
}}
onDrop
=
{(
e
)
=>
{
dropHandler
(
e
)
}}
>
>
{
children
}
{
children
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment