Commit ec8a3d0b authored by Kim, Subin's avatar Kim, Subin
Browse files

기본 구조 생성

parent a7bd8233
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>
);
}
......
const Menu = () => {
return (
<></>
)
}
export default Menu
\ No newline at end of file
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
const ScheduleForm = () => {
return (
<></>
)
}
export default ScheduleForm
\ No newline at end of file
const AdminPage = () => {
return (
<></>
)
}
export default AdminPage
\ No newline at end of file
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
const HomePage = () => {
return (
<></>
)
}
export default HomePage
\ No newline at end of file
const ScheduleEditPage = () => {
return (
<></>
)
}
export default ScheduleEditPage
\ No newline at end of file
const SchedulePage = () => {
return (
<></>
)
}
export default SchedulePage
\ No newline at end of file
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