TicketingTheater.js 807 Bytes
Newer Older
Jiwon Yoon's avatar
Jiwon Yoon committed
1
2
3
import styles from "./ticketingTheater.module.scss"
const TicketingTheater = (props) => {

Jiwon Yoon's avatar
Jiwon Yoon committed
4
5
6
7
8
9
    function handleClick(event) {
        // event.preventDefault()
        console.log(event.target.name)
        props.setTicketInfo({ ...props.ticketInfo, theater:event.target.name})
    }

Jiwon Yoon's avatar
Jiwon Yoon committed
10
    return (
Jiwon Yoon's avatar
Jiwon Yoon committed
11
        <div >
Jiwon Yoon's avatar
Jiwon Yoon committed
12
            <div className="d-grid gap-2">
Jiwon Yoon's avatar
Jiwon Yoon committed
13
14
15
                {props.theaterInfo.theater.length > 0
                    ? props.theaterInfo.theater.map(name => (
                        <button name={name} className={`${props.ticketInfo.theater === name ? styles.on : styles.btn}`} onClick={handleClick}>{name}</button>
Jiwon Yoon's avatar
Jiwon Yoon committed
16
                    ))
Jiwon Yoon's avatar
Jiwon Yoon committed
17
                    : <div>영화관 정보가 존재하지 않습니다.</div>}
Jiwon Yoon's avatar
Jiwon Yoon committed
18
19
20
21
22
23
            </div>
        </div>
    )
}

export default TicketingTheater