-
Notifications
You must be signed in to change notification settings - Fork 0
/
TabRouters.js
27 lines (25 loc) · 999 Bytes
/
TabRouters.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import React from "react";
import { Route, Switch, Redirect } from "react-router-dom";
import { RoutedTabs, NavTab } from "react-router-tabs";
import { Admins, Moderators, Users } from "./components";
import "styles/react-router-tabs.css";
import Router from './Router';
const UsersPage = ({ match }) => {
return (
<div>
<NavTab to="/">Home</NavTab>
<NavTab to="/details">Moderators</NavTab>
<NavTab to="/list">Users</NavTab>
<Switch>
<Route
exact
path={`${match.path}`}
render={() => <Redirect replace to={`${match.path}/admins`} />}/>
<Route path={`${match.path}/`} component={Admins} />
<Route path={`${match.path}/details`} component={Moderators} />
<Route path={`${match.path}/list`} component={Users} />
</Switch>
</div>
);
};
export default UsersPage;