Commit c10ff7b7 authored by 한규민's avatar 한규민
Browse files

다시

parent 3c84b7c1
import React, { useState, useEffect } from "react";
import { BrowserRouter as Router, Route, Switch } from "react-router-dom"; import { BrowserRouter as Router, Route, Switch } from "react-router-dom";
import Header from "./components/Header"; import Header from "./components/Header";
import SubNav from "./components/Navs/SubNav"; import SubNav from "./components/Navs/SubNav";
...@@ -13,27 +14,34 @@ import AdminPage from "./pages/AdminPage/AdminPage"; ...@@ -13,27 +14,34 @@ import AdminPage from "./pages/AdminPage/AdminPage";
import TicketingPage from "./pages/TicketingPage"; import TicketingPage from "./pages/TicketingPage";
import SearchPage from "./pages/SearchPage"; import SearchPage from "./pages/SearchPage";
function App() { const AppContext = React.createContext();
function App() {
const [role, setRole] = useState("user");
const store = {role, setRole};
return ( return (
<div className="" style={{ backgroundColor: "black" }}> <div className="" style={{ backgroundColor: "black" }}>
<Router style={{ backgroundColor: "black" }}> <AppContext.Provider value={store}>
<SubNav /> <Router style={{ backgroundColor: "black" }}>
<Header /> <SubNav />
<MainNav /> <Header />
<Switch> <MainNav />
<Route exact path="/" component={HomePage} /> <Switch>
<Route path="/login" component={LoginPage} /> <Route exact path="/" component={HomePage} />
<Route path="/signup" component={SignupPage} /> <Route path="/login" component={LoginPage} />
<Route path="/movielist" component={MovieListPage} /> <Route path="/signup" component={SignupPage} />
<Route path="/movie/:movieId" component={MoviePage} /> <Route path="/movielist" component={MovieListPage} />
<Route path="/ticket" component={TicketingPage} /> <Route path="/movie/:movieId" component={MoviePage} />
<Route path="/search" component={SearchPage} /> <Route path="/ticket" component={TicketingPage} />
<Route path="/admin" component={AdminPage} /> <Route path="/search" component={SearchPage} />
</Switch> <Route path="/admin" component={AdminPage} />
</Router> </Switch>
// </div> </Router>
</AppContext.Provider>
</div>
); );
} }
export { AppContext }
export default App; export default App;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment