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
Today KU
Commits
ec8a3d0b
Commit
ec8a3d0b
authored
Oct 04, 2021
by
Kim, Subin
Browse files
기본 구조 생성
parent
a7bd8233
Changes
9
Show whitespace changes
Inline
Side-by-side
client/src/App.js
View file @
ec8a3d0b
import
{
BrowserRouter
as
Router
,
Route
,
Switch
}
from
"
react-router-dom
"
;
import
HomePage
from
"
./pages/HomePage
"
;
import
SchedulePage
from
"
./pages/SchedulePage
"
;
import
ScheduleEditPage
from
"
./pages/ScheduleEditPage
"
;
import
AdminPage
from
"
./pages/AdminPage
"
;
import
PrivateRoute
from
"
./components/PrivateRoute
"
;
import
Err
from
"
./pages/ErrorPage
"
;
function
App
()
{
return
(
<><
/
>
<
Router
basename
=
{
process
.
env
.
PUBLIC_URL
}
>
<
Switch
>
<
Route
path
=
"
/
"
component
=
{
Err
}
/
>
<
Route
path
=
"
/home
"
component
=
{
HomePage
}
/
>
<
Route
path
=
"
/schedule/edit
"
component
=
{
ScheduleEditPage
}
/
>
<
Route
path
=
"
/schedule
"
component
=
{
SchedulePage
}
/
>
<
PrivateRoute
path
=
"
/admin
"
component
=
{
AdminPage
}
role
=
"
admin
"
/>
<
/Switch
>
<
/Router
>
);
}
...
...
client/src/components/Menu/Menu.js
0 → 100644
View file @
ec8a3d0b
const
Menu
=
()
=>
{
return
(
<><
/
>
)
}
export
default
Menu
\ No newline at end of file
client/src/components/PrivateRoute.js
0 → 100644
View file @
ec8a3d0b
import
{
Redirect
,
Route
}
from
"
react-router-dom
"
;
// import { useAuth } from "../context/auth_context";
import
ErrorPage
from
"
../pages/ErrorPage
"
;
const
PrivateRoute
=
({
component
,
...
rest
})
=>
{
// const { user } = useAuth();
// return (
// <Route
// {...rest}
// render={(props) => {
// if (user) {
// if (rest.role) {
// if (rest.role === user.role) {
// return <Component {...props} />;
// } else {
// return <ErrorPage />
// }
// } else {
// return <Component {...props} />
// }
// } else {
// return <Redirect to="/login" />;
// }
// }}
// />
// );
};
export
default
PrivateRoute
;
\ No newline at end of file
client/src/components/ScheduleForm.js
0 → 100644
View file @
ec8a3d0b
const
ScheduleForm
=
()
=>
{
return
(
<><
/
>
)
}
export
default
ScheduleForm
\ No newline at end of file
client/src/pages/AdminPage.js
0 → 100644
View file @
ec8a3d0b
const
AdminPage
=
()
=>
{
return
(
<><
/
>
)
}
export
default
AdminPage
\ No newline at end of file
client/src/pages/ErrorPage.js
0 → 100644
View file @
ec8a3d0b
const
ErrorPage
=
()
=>
{
return
(
<
div
className
=
"
bg-white
"
id
=
"
notfound
"
>
<
div
className
=
"
notfound
"
style
=
{{
backgroundImage
:
`url(/ku-tiger.png)`
,
backgroundSize
:
"
cover
"
}}
>
<
div
className
=
"
notfound-404
"
><
/div
>
<
h1
>
404
<
/h1
>
<
h2
>
Oops
!
Page
Not
Be
Found
<
/h2
>
<
p
>
Sorry
but
the
page
you
are
looking
for
does
not
exist
,
have
been
removed
.
name
changed
or
is
temporarily
unavailable
<
/p
>
<
a
href
=
"
/
"
>
Back
to
homepage
<
/a
>
<
/div
>
<
/div
>
)
}
export
default
ErrorPage
\ No newline at end of file
client/src/pages/HomePage.js
0 → 100644
View file @
ec8a3d0b
const
HomePage
=
()
=>
{
return
(
<><
/
>
)
}
export
default
HomePage
\ No newline at end of file
client/src/pages/ScheduleEditPage.js
0 → 100644
View file @
ec8a3d0b
const
ScheduleEditPage
=
()
=>
{
return
(
<><
/
>
)
}
export
default
ScheduleEditPage
\ No newline at end of file
client/src/pages/SchedulePage.js
0 → 100644
View file @
ec8a3d0b
const
SchedulePage
=
()
=>
{
return
(
<><
/
>
)
}
export
default
SchedulePage
\ No newline at end of file
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