TicketingTheater.js 634 Bytes
Newer Older
Jiwon Yoon's avatar
Jiwon Yoon committed
1
import styles from "./ticketingTheater.module.scss"
Kim, Subin's avatar
Kim, Subin committed
2
3

const TicketingTheater = ({ ticketInfo, cinemaInfo, setTicketInfo }) => {
Jiwon Yoon's avatar
Jiwon Yoon committed
4

Jiwon Yoon's avatar
Jiwon Yoon committed
5
    function handleClick(event) {
Jiwon Yoon's avatar
Jiwon Yoon committed
6
        setTicketInfo({ ...ticketInfo, cinema: event.target.name })
Jiwon Yoon's avatar
Jiwon Yoon committed
7
8
    }

Jiwon Yoon's avatar
Jiwon Yoon committed
9
    return (
Jiwon Yoon's avatar
Jiwon Yoon committed
10
        <div className="d-grid gap-2">
Jiwon Yoon's avatar
Jiwon Yoon committed
11
12
13
14
15
16
            {cinemaInfo
                ?
                <button name={cinemaInfo.cinemaName} className={`${ticketInfo.cinema === cinemaInfo.cinemaName ? styles.on : styles.btn}`} onClick={handleClick}>{cinemaInfo.cinemaName}</button>
                :
                <></>
            }
Jiwon Yoon's avatar
Jiwon Yoon committed
17
18
19
20
21
        </div>
    )
}

export default TicketingTheater