TicketingTheater.js 646 Bytes
Newer Older
Jiwon Yoon's avatar
Jiwon Yoon committed
1
import styles from "./ticketingTheater.module.scss"
Jiwon Yoon's avatar
Jiwon Yoon committed
2
const TicketingTheater = ({ticketInfo, cinemaInfo, setTicketInfo}) => {
Jiwon Yoon's avatar
Jiwon Yoon committed
3

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

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
                <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
14
15
16
17
18
19
            </div>
        </div>
    )
}

export default TicketingTheater