feat: initial commit
This commit is contained in:
29
src/routes/app.js
Normal file
29
src/routes/app.js
Normal file
@@ -0,0 +1,29 @@
|
||||
import {Redirect, Route, Switch} from "react-router-dom";
|
||||
import {Home} from "../pages/Home/Home";
|
||||
import {About} from "../pages/About/About";
|
||||
import {Membership} from "../pages/Membership/Membership";
|
||||
import {Product} from "../pages/Product/Product";
|
||||
import {Transaction} from "../pages/Transaction/Transaction";
|
||||
|
||||
export const AppRoute = () => {
|
||||
return <Switch>
|
||||
<Route path={"/app/home"}>
|
||||
<Home/>
|
||||
</Route>
|
||||
<Route path={"/app/membership"}>
|
||||
<Membership/>
|
||||
</Route>
|
||||
<Route path={"/app/product"}>
|
||||
<Product/>
|
||||
</Route>
|
||||
<Route path={"/app/transaction"}>
|
||||
<Transaction/>
|
||||
</Route>
|
||||
<Route path={"/app/about"}>
|
||||
<About/>
|
||||
</Route>
|
||||
<Route path="/app" exact>
|
||||
<Redirect to={'/app/home'}/>
|
||||
</Route>
|
||||
</Switch>
|
||||
}
|
||||
16
src/routes/index.js
Normal file
16
src/routes/index.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import {Redirect, Route, Switch} from "react-router-dom";
|
||||
import {Login} from "../pages/Login/Login";
|
||||
import {PublicRoute} from "../component/PublicRoute";
|
||||
import {App} from "../pages/App/App";
|
||||
|
||||
export const MainRoutes = (props) => {
|
||||
return (
|
||||
<Switch>
|
||||
<Route path="/" exact>
|
||||
<Redirect to={"/app/home"}/>
|
||||
</Route>
|
||||
<PublicRoute restricted={true} component={Login} path="/login" exact/>
|
||||
<PublicRoute component={App} path="/app"/>
|
||||
</Switch>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user