MovieListPage.js 1.11 KB
Newer Older
1
2
import { useState } from 'react'
import MovieChart from '../components/MovieChart.js'
Jiwon Yoon's avatar
Jiwon Yoon committed
3
import MovieComing from '../components/MovieComing.js'
4

5
const MovieListPage = () => {
6
    const [state, setState] = useState(0)
7

8
    return (
Jiwon Yoon's avatar
Jiwon Yoon committed
9
        <div className="container">
10
11
12
13
14
            <div className="text-center my-5">
                <button className="mx-auto" style={{ color: "white", borderColor: "black", backgroundColor: "black", borderBottom: !state ? "3px solid" : "none", borderBottomColor: !state ? "#FEDC00" : "black" }} type="button" onClick={() => setState(0)}>무비차트</button>

                <button className="mx-auto" style={{ color: "white", borderColor: "black", backgroundColor: "black", borderBottom: !state ? "none" : "3px solid", borderBottomColor: !state ? "black" : "#FEDC00" }} type="button" onClick={() => setState(1)}>상영예정작</button>

Jiwon Yoon's avatar
Jiwon Yoon committed
15
            </div>
16
17
18
            <div>
                {state === 0
                    ?
Jiwon Yoon's avatar
Jiwon Yoon committed
19
                    <MovieChart />
20
                    :
Jiwon Yoon's avatar
Jiwon Yoon committed
21
                    <MovieComing />
22
                }
Jiwon Yoon's avatar
Jiwon Yoon committed
23
            </div>
24
25
26
27
28
        </div>
    )
}

export default MovieListPage