Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
butter-studio
Commits
c10ff7b7
Commit
c10ff7b7
authored
Jul 24, 2021
by
한규민
Browse files
다시
parent
3c84b7c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
client/src/App.js
View file @
c10ff7b7
import
React
,
{
useState
,
useEffect
}
from
"
react
"
;
import
{
BrowserRouter
as
Router
,
Route
,
Switch
}
from
"
react-router-dom
"
;
import
Header
from
"
./components/Header
"
;
import
SubNav
from
"
./components/Navs/SubNav
"
;
...
...
@@ -13,27 +14,34 @@ import AdminPage from "./pages/AdminPage/AdminPage";
import
TicketingPage
from
"
./pages/TicketingPage
"
;
import
SearchPage
from
"
./pages/SearchPage
"
;
function
App
()
{
const
AppContext
=
React
.
createContext
();
function
App
()
{
const
[
role
,
setRole
]
=
useState
(
"
user
"
);
const
store
=
{
role
,
setRole
};
return
(
<
div
className
=
""
style
=
{{
backgroundColor
:
"
black
"
}}
>
<
Router
style
=
{{
backgroundColor
:
"
black
"
}}
>
<
SubNav
/>
<
Header
/>
<
MainNav
/>
<
Switch
>
<
Route
exact
path
=
"
/
"
component
=
{
HomePage
}
/
>
<
Route
path
=
"
/login
"
component
=
{
LoginPage
}
/
>
<
Route
path
=
"
/signup
"
component
=
{
SignupPage
}
/
>
<
Route
path
=
"
/movielist
"
component
=
{
MovieListPage
}
/
>
<
Route
path
=
"
/movie/:movieId
"
component
=
{
MoviePage
}
/
>
<
Route
path
=
"
/ticket
"
component
=
{
TicketingPage
}
/
>
<
Route
path
=
"
/search
"
component
=
{
SearchPage
}
/
>
<
Route
path
=
"
/admin
"
component
=
{
AdminPage
}
/
>
<
/Switch
>
<
/Router
>
// </div>
<
AppContext
.
Provider
value
=
{
store
}
>
<
Router
style
=
{{
backgroundColor
:
"
black
"
}}
>
<
SubNav
/>
<
Header
/>
<
MainNav
/>
<
Switch
>
<
Route
exact
path
=
"
/
"
component
=
{
HomePage
}
/
>
<
Route
path
=
"
/login
"
component
=
{
LoginPage
}
/
>
<
Route
path
=
"
/signup
"
component
=
{
SignupPage
}
/
>
<
Route
path
=
"
/movielist
"
component
=
{
MovieListPage
}
/
>
<
Route
path
=
"
/movie/:movieId
"
component
=
{
MoviePage
}
/
>
<
Route
path
=
"
/ticket
"
component
=
{
TicketingPage
}
/
>
<
Route
path
=
"
/search
"
component
=
{
SearchPage
}
/
>
<
Route
path
=
"
/admin
"
component
=
{
AdminPage
}
/
>
<
/Switch
>
<
/Router
>
<
/AppContext.Provider
>
<
/div
>
);
}
export
{
AppContext
}
export
default
App
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment