Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
butter-studio
Commits
2c7fb054
Commit
2c7fb054
authored
Jul 27, 2021
by
Kim, Subin
Browse files
수정 버튼 클릭 시 form으로 이동
parent
0eae2912
Changes
2
Show whitespace changes
Inline
Side-by-side
client/src/components/Admin/CinemaEdit.js
View file @
2c7fb054
import
{
useState
,
useEffect
}
from
"
react
"
;
import
{
useState
,
useEffect
,
useRef
}
from
"
react
"
;
import
TicketEditForm
from
"
./TicketEditForm.js
"
;
import
TicketEditForm
from
"
./TicketEditForm.js
"
;
import
TicketFeeTable
from
"
./TicketFeeTable.js
"
;
import
TicketFeeTable
from
"
./TicketFeeTable.js
"
;
import
cinemaApi
from
"
../../apis/cinema.api.js
"
;
import
cinemaApi
from
"
../../apis/cinema.api.js
"
;
...
@@ -17,6 +17,7 @@ const CinemaEdit = () => {
...
@@ -17,6 +17,7 @@ const CinemaEdit = () => {
const
[
cinemaInfo
,
setCinemaInfo
]
=
useState
(
INIT_CINEMAINFO
)
const
[
cinemaInfo
,
setCinemaInfo
]
=
useState
(
INIT_CINEMAINFO
)
const
[
ticketFee
,
setTicketFee
]
=
useState
({})
const
[
ticketFee
,
setTicketFee
]
=
useState
({})
const
[
error
,
setError
]
=
useState
(
""
)
const
[
error
,
setError
]
=
useState
(
""
)
const
formRef
=
useRef
(
null
)
useEffect
(()
=>
{
useEffect
(()
=>
{
getInfo
()
getInfo
()
...
@@ -71,8 +72,8 @@ const CinemaEdit = () => {
...
@@ -71,8 +72,8 @@ const CinemaEdit = () => {
<
/div
>
<
/div
>
<
p
className
=
"
mb-0
"
>
영화관람료
설정
<
/p
>
<
p
className
=
"
mb-0
"
>
영화관람료
설정
<
/p
>
<
p
className
=
"
text-danger
"
>*
추가금액
정보를
입력바랍니다
.
필요에
따라
기본가격
또한
변경
가능합니다
.
<
/p
>
<
p
className
=
"
text-danger
"
>*
추가금액
정보를
입력바랍니다
.
필요에
따라
기본가격
또한
변경
가능합니다
.
<
/p
>
<
TicketEditForm
editFee
=
{
ticketFee
}
/
>
<
TicketEditForm
editFee
=
{
ticketFee
}
formRef
=
{
formRef
}
/
>
<
TicketFeeTable
setEditFee
=
{
setTicketFee
}
/
>
<
TicketFeeTable
setEditFee
=
{
setTicketFee
}
formRef
=
{
formRef
}
/
>
<
div
className
=
"
mb-3
"
>
<
div
className
=
"
mb-3
"
>
<
label
for
=
"
moreFeeInfo
"
className
=
"
form-label
"
>
관람료
추가정보
<
/label
>
<
label
for
=
"
moreFeeInfo
"
className
=
"
form-label
"
>
관람료
추가정보
<
/label
>
<
textarea
className
=
{
`form-control
${
styles
.
shadowNone
}
${
styles
.
textarea
}
`
}
rows
=
"
7
"
id
=
"
moreFeeInfo
"
name
=
"
moreFeeInfo
"
value
=
{
cinemaInfo
.
moreFeeInfo
}
onChange
=
{
handleChange
}
><
/textarea
>
<
textarea
className
=
{
`form-control
${
styles
.
shadowNone
}
${
styles
.
textarea
}
`
}
rows
=
"
7
"
id
=
"
moreFeeInfo
"
name
=
"
moreFeeInfo
"
value
=
{
cinemaInfo
.
moreFeeInfo
}
onChange
=
{
handleChange
}
><
/textarea
>
...
...
client/src/components/Admin/TicketFeeTable.js
View file @
2c7fb054
...
@@ -3,7 +3,7 @@ import cinemaApi from "../../apis/cinema.api.js";
...
@@ -3,7 +3,7 @@ import cinemaApi from "../../apis/cinema.api.js";
import
catchErrors
from
"
../../utils/catchErrors.js
"
;
import
catchErrors
from
"
../../utils/catchErrors.js
"
;
import
styles
from
"
./admin.module.scss
"
;
import
styles
from
"
./admin.module.scss
"
;
const
TicketFeeTable
=
({
setEditFee
})
=>
{
const
TicketFeeTable
=
({
setEditFee
,
formRef
})
=>
{
const
[
ticketFee
,
setTicketFee
]
=
useState
([])
const
[
ticketFee
,
setTicketFee
]
=
useState
([])
const
[
error
,
setError
]
=
useState
(
""
)
const
[
error
,
setError
]
=
useState
(
""
)
...
@@ -21,6 +21,7 @@ const TicketFeeTable = ({ setEditFee }) => {
...
@@ -21,6 +21,7 @@ const TicketFeeTable = ({ setEditFee }) => {
setError
(
""
)
setError
(
""
)
const
res
=
await
cinemaApi
.
getTicketFeeOne
(
theaterType
)
const
res
=
await
cinemaApi
.
getTicketFeeOne
(
theaterType
)
setEditFee
({
...
res
})
setEditFee
({
...
res
})
formRef
?.
current
.
scrollIntoView
({
behavior
:
"
smooth
"
,
block
:
"
center
"
})
}
catch
(
error
)
{
}
catch
(
error
)
{
catchErrors
(
error
,
setError
)
catchErrors
(
error
,
setError
)
}
}
...
...
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