CinemaEdit.js 2.14 KB
Newer Older
Kim, Subin's avatar
Kim, Subin committed
1
2
3
4
import { useState } from "react";
import KakaoMap from "../KakaoMap";
import styles from "./admin.module.scss";

Kim, Subin's avatar
Kim, Subin committed
5
const CinemaEdit = () => {
Kim, Subin's avatar
Kim, Subin committed
6
    const [cinemaInfo, setCinemaInfo] = useState({ cinema: "", transportation: "", parking: "", address: "" })
Kim, Subin's avatar
Kim, Subin committed
7
8
    const [search, setSearch] = useState("")

Kim, Subin's avatar
Kim, Subin committed
9
10
    function handleChange(e) {
        const { name, value } = e.target
Kim, Subin's avatar
Kim, Subin committed
11
        setCinemaInfo({ ...cinemaInfo, [name]: value })
Kim, Subin's avatar
Kim, Subin committed
12
13
14
15
16
    }

    return (
        <>
            <h2 className="border-bottom border-2 text-center pb-2 me-2">현재 영화관 정보</h2>
Kim, Subin's avatar
Kim, Subin committed
17
            <input type="text" className={`form-control mb-2 ${styles.shadowNone}`} id="cinema" name="cinema" onChange={handleChange} />
Kim, Subin's avatar
Kim, Subin committed
18
19
20
            <p> 상영관 : 8개관 |  좌석 : 1,282</p>
            <div className="mb-3">
                <label for="transportation" className="form-label">대중교통 안내</label>
Kim, Subin's avatar
Kim, Subin committed
21
                <textarea className={`form-control ${styles.shadowNone} ${styles.textarea}`} rows="7" id="transportation" name="transportation" onChange={handleChange}></textarea>
Kim, Subin's avatar
Kim, Subin committed
22
23
            </div>
            <div className="mb-3">
Kim, Subin's avatar
Kim, Subin committed
24
                <label for="parking" className="form-label">자가용/주차안내</label>
Kim, Subin's avatar
Kim, Subin committed
25
26
                <textarea className={`form-control ${styles.shadowNone} ${styles.textarea}`} rows="7" id="parking" name="parking" onChange={handleChange}></textarea>
            </div>
Kim, Subin's avatar
Kim, Subin committed
27
            <label for="address" className="form-label">지도보기</label>
Kim, Subin's avatar
Kim, Subin committed
28
29
            <div className="input-group mb-3">
                <span className="input-group-text" id="currentMap"><i className="bi bi-geo-alt-fill"></i></span>
Kim, Subin's avatar
Kim, Subin committed
30
31
                <input type="text" className={`form-control ${styles.shadowNone}`} id="address" name="address" aria-label="map" aria-describedby="currentMap" onChange={handleChange} />
                <button className="btn btn-dark" type="button" id="currentMap" onClick={() => setSearch(cinemaInfo.address)}><i className="bi bi-search"></i></button>
Kim, Subin's avatar
Kim, Subin committed
32
33
            </div>
            <div className="d-flex justify-content-center mb-5">
Kim, Subin's avatar
Kim, Subin committed
34
                <KakaoMap address={search} />
Kim, Subin's avatar
Kim, Subin committed
35
36
37
38
39
            </div>
        </>
    )
}
export default CinemaEdit