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
f766ad1f
Commit
f766ad1f
authored
Dec 20, 2022
by
Ermolaev Timur
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'task-114-fix/fix_modal' into 'development'
#114
Немного подправил расчеты See merge request
!92
parents
a495d104
50dc0d6a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
13 deletions
+23
-13
ModalTask.js
...ner-front/src/components/Calendars/ModalTask/ModalTask.js
+19
-10
MonthCalendarBody.js
...dars/MonthCalendar/MonthCalendarBody/MonthCalendarBody.js
+1
-1
CalendarWeekTask.js
...alendarColumnDayWeek/CalendarWeekTask/CalendarWeekTask.js
+1
-1
WeekCalendarBody.js
...lendars/WeekCalendar/WeekCalendarBody/WeekCalendarBody.js
+2
-1
No files found.
planner-front/src/components/
UI
/ModalTask/ModalTask.js
→
planner-front/src/components/
Calendars
/ModalTask/ModalTask.js
View file @
f766ad1f
import
Box
from
'@mui/material/Box'
;
import
Modal
from
'@mui/material/Modal'
;
import
{
use
Effect
,
useState
}
from
'react'
;
import
{
use
Callback
,
useEffect
,
useMemo
,
useState
}
from
'react'
;
export
default
function
ModalTask
({
modal
,
handleClose
,
children
})
{
export
default
function
ModalTask
({
modal
,
handleClose
,
children
,
week
})
{
const
[
windowDimenion
,
detectHW
]
=
useState
({
winWidth
:
window
.
innerWidth
,
...
...
@@ -24,21 +24,30 @@ export default function ModalTask({modal, handleClose, children}) {
}
},
[
windowDimenion
])
const
getYCordinatesToModal
=
()
=>
{
if
(
windowDimenion
.
winHeight
>
modal
.
yClick
С
ordinates
+
450
)
{
return
modal
.
yClick
С
ordinates
-
modal
.
yDiv
-
modal
.
yDivClick
const
getYCordinatesToModal
=
useCallback
(()
=>
{
if
(
week
)
{
if
(
windowDimenion
.
winHeight
>
modal
.
yClick
С
ordinates
+
450
)
{
return
modal
.
yClick
С
ordinates
-
modal
.
yDivClick
}
else
{
return
modal
.
yClick
С
ordinates
-
450
}
}
else
{
return
modal
.
yClick
С
ordinates
-
modal
.
yDiv
-
modal
.
yDivClick
-
((
modal
.
yClick
С
ordinates
+
450
)
-
windowDimenion
.
winHeight
)
-
30
if
(
windowDimenion
.
winHeight
>
modal
.
yClick
С
ordinates
+
450
)
{
return
modal
.
yClick
С
ordinates
-
modal
.
yDiv
-
modal
.
yDivClick
}
else
{
return
modal
.
yClick
С
ordinates
-
modal
.
yDiv
-
modal
.
yDivClick
-
((
modal
.
yClick
С
ordinates
+
450
)
-
windowDimenion
.
winHeight
)
-
30
}
}
}
const
getXCordinatesToModal
=
()
=>
{
},
[
windowDimenion
.
winHeight
,
modal
])
const
getXCordinatesToModal
=
useCallback
(()
=>
{
if
(
windowDimenion
.
winWidth
>
modal
.
xClick
С
ordinates
+
270
+
modal
.
xDiv
)
{
return
modal
.
xClick
С
ordinates
+
modal
.
xDiv
-
modal
.
xDivClick
+
10
}
else
{
return
windowDimenion
.
winWidth
-
(
windowDimenion
.
winWidth
-
modal
.
xClick
С
ordinates
)
-
modal
.
xDivClick
-
270
-
80
}
}
},
[
windowDimenion
.
winWidth
,
modal
])
const
style
=
{
display
:
'flex'
,
flexDirection
:
'column'
,
...
...
planner-front/src/components/Calendars/MonthCalendar/MonthCalendarBody/MonthCalendarBody.js
View file @
f766ad1f
...
...
@@ -3,7 +3,7 @@ import { useCallback, useState } from "react";
import
CalendarRow
from
"../../CalendarRow/CalendarRow"
;
import
CalendarSmallCell
from
"../../CalendarSmallCell/CalendarSmallCell"
;
import
CalendarStandartCell
from
"../../CalendarStandartCell/CalendarStandartCell"
;
import
ModalTask
from
"../../
../UI/
ModalTask/ModalTask"
import
ModalTask
from
"../../ModalTask/ModalTask"
import
MonthCalendarModalContent
from
"../../CalendarModalTaskContent/CalendarModalTaskContent"
;
import
CalendarRowDay
from
"./CalendarRowDay/CalendarRowDay"
;
...
...
planner-front/src/components/Calendars/WeekCalendar/WeekCalendarBody/CalendarColumnDayWeek/CalendarWeekTask/CalendarWeekTask.js
View file @
f766ad1f
...
...
@@ -30,7 +30,7 @@ function CalendarWeekTask({ height, width, left, top, task, zIndex, handleOpen,
});
setZIndexStyle
(
100
)
handleOpen
(
e
)
},
[
handleOpen
,
setCurrentTask
])
},
[
handleOpen
,
setCurrentTask
,
month
])
const
styles
=
{
boxSizing
:
'border-box'
,
...
...
planner-front/src/components/Calendars/WeekCalendar/WeekCalendarBody/WeekCalendarBody.js
View file @
f766ad1f
import
{
Grid
}
from
"@mui/material"
;
import
{
Box
}
from
"@mui/system"
;
import
{
useCallback
,
useState
}
from
"react"
;
import
ModalTask
from
"../../
../UI/
ModalTask/ModalTask"
;
import
ModalTask
from
"../../ModalTask/ModalTask"
;
import
MonthCalendarModalContent
from
"../../CalendarModalTaskContent/CalendarModalTaskContent"
;
import
CalendarRow
from
"../../CalendarRow/CalendarRow"
;
import
CalendarSmallCell
from
"../../CalendarSmallCell/CalendarSmallCell"
;
...
...
@@ -95,6 +95,7 @@ function WeekCalendarBody({ week, hoursInDay, hourFormat, setHourFormat, date, t
<
ModalTask
modal
=
{
modal
}
handleClose
=
{()
=>
{
handleClose
()
}}
week
=
{
true
}
>
<
MonthCalendarModalContent
title
=
{
currentTask
.
title
}
...
...
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