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
1611ef67
Commit
1611ef67
authored
Nov 26, 2022
by
Ermolaev Timur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#66
Небольшие поправки
parent
8b6c5d95
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
14 deletions
+37
-14
MonthCalendarModalContent.js
...ts/MonthCalendarModalContent/MonthCalendarModalContent.js
+23
-3
ModalTask.js
planner-front/src/components/UI/ModalTask/ModalTask.js
+13
-10
Select.js
planner-front/src/components/UI/Select/Select.js
+1
-1
No files found.
planner-front/src/components/MonthCalendarModalContent/MonthCalendarModalContent.js
View file @
1611ef67
import
{
Button
,
FormControl
,
InputLabel
,
MenuItem
,
Select
,
TextField
}
from
"@mui/material"
;
import
{
Button
,
TextField
}
from
"@mui/material"
;
import
{
memo
}
from
"react"
;
import
CustomSelect
from
'../UI/СustomSelect/СustomSelect'
...
...
@@ -38,8 +38,28 @@ function MonthCalendarModalContent({title, onChangeCurrentTaskHandler, descripti
id
=
{
'priority-type'
}
items
=
{
priorities
}
/
>
<
Button
sx
=
{{
marginRight
:
'40px'
}}
onClick
=
{
sendNewTaskHandler
}
>
Сохранить
<
/Button
>
<
div
style
=
{{
display
:
'flex'
,
gap
:
'20px'
,
margin
:
'20px 0'
}}
>
<
TextField
id
=
"task-description-title"
value
=
{
title
}
label
=
"От"
variant
=
"outlined"
name
=
'title'
onChange
=
{(
e
)
=>
{
onChangeCurrentTaskHandler
(
e
)}}
/
>
<
TextField
id
=
"task-description-title"
value
=
{
title
}
label
=
"До"
variant
=
"outlined"
name
=
'title'
onChange
=
{(
e
)
=>
{
onChangeCurrentTaskHandler
(
e
)}}
/
>
<
/div
>
<
div
style
=
{{
display
:
'flex'
,
gap
:
'20px'
,
margin
:
'10px 0'
}}
>
<
Button
onClick
=
{
sendNewTaskHandler
}
>
Сохранить
<
/Button
>
<
Button
onClick
=
{
deleteTaskHandler
}
>
Удалить
<
/Button
>
<
/div
>
<
/>
)
;
}
...
...
planner-front/src/components/UI/ModalTask/ModalTask.js
View file @
1611ef67
import
Box
from
'@mui/material/Box'
;
import
Modal
from
'@mui/material/Modal'
;
import
{
useEffect
,
useState
}
from
'react'
;
import
{
useEffect
,
use
Ref
,
use
State
}
from
'react'
;
export
default
function
ModalTask
({
modal
,
handleClose
,
children
})
{
...
...
@@ -19,32 +19,35 @@ export default function ModalTask({modal, handleClose, children}) {
useEffect
(()
=>
{
window
.
addEventListener
(
'resize'
,
detectSize
)
return
()
=>
{
window
.
removeEventListener
(
'resize'
,
detectSize
)
}
},
[
windowDimenion
])
const
modalRef
=
useRef
(
''
)
const
getYCordinatesToModal
=
()
=>
{
if
(
windowDimenion
.
winHeight
>
modal
.
yClick
С
ordinates
+
3
50
)
{
if
(
windowDimenion
.
winHeight
>
modal
.
yClick
С
ordinates
+
4
50
)
{
return
modal
.
yClick
С
ordinates
-
modal
.
yDiv
-
modal
.
yDivClick
}
else
{
return
modal
.
yClick
С
ordinates
-
modal
.
yDiv
-
modal
.
yDivClick
-
((
modal
.
yClick
С
ordinates
+
350
)
-
windowDimenion
.
winHeight
)
-
1
0
return
modal
.
yClick
С
ordinates
-
modal
.
yDiv
-
modal
.
yDivClick
-
((
modal
.
yClick
С
ordinates
+
450
)
-
windowDimenion
.
winHeight
)
-
3
0
}
}
const
getXCordinatesToModal
=
()
=>
{
if
(
windowDimenion
.
winWidth
>
modal
.
xClick
С
ordinates
+
modal
.
xDiv
+
250
+
modal
.
xDivClick
)
{
if
(
windowDimenion
.
winWidth
>
modal
.
xClick
С
ordinates
+
270
+
modal
.
xDiv
)
{
return
modal
.
xClick
С
ordinates
+
modal
.
xDiv
-
modal
.
xDivClick
+
10
}
else
{
return
modal
.
xClick
С
ordinates
-
modal
.
xDiv
-
((
modal
.
xClick
С
ordinates
+
250
)
-
windowDimenion
.
winWidth
)
-
120
return
modal
.
xClick
С
ordinates
-
modal
.
xDiv
Click
-
((
modal
.
yClick
С
ordinates
+
270
)
-
windowDimenion
.
winHeight
)
}
}
const
style
=
{
display
:
'flex'
,
flexDirection
:
'column'
,
position
:
'absolute'
,
top
:
getYCordinatesToModal
(),
left
:
getXCordinatesToModal
(),
width
:
2
5
0
,
height
:
3
50
,
width
:
2
7
0
,
height
:
4
50
,
bgcolor
:
'background.paper'
,
border
:
'2px solid #000'
,
boxShadow
:
24
,
...
...
@@ -59,7 +62,7 @@ export default function ModalTask({modal, handleClose, children}) {
aria
-
describedby
=
"modal-modal-description"
BackdropProps
=
{{
style
:
{
backgroundColor
:
'rgba(255,255,255, 0)'
}
}}
>
<
Box
sx
=
{
style
}
>
<
Box
sx
=
{
style
}
ref
=
{
modalRef
}
>
{
children
}
<
/Box
>
<
/Modal
>
...
...
planner-front/src/components/UI/Select/Select.js
View file @
1611ef67
...
...
@@ -8,7 +8,7 @@ import Select from "@mui/material/Select";
export
default
function
BasicSelect
({
value
,
label
,
name
,
onChange
,
task
,
items
})
{
return
(
<
Box
sx
=
{{
minWidth
:
60
}}
>
<
Box
sx
=
{{
minWidth
:
60
,
m
:
0
}}
>
<
FormControl
fullWidth
>
<
InputLabel
id
=
"demo-simple-select-label"
><
/InputLabel
>
<
Select
...
...
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