remove DashboardPage

This commit is contained in:
Dawid Wysokiński 2021-03-12 13:46:44 +01:00
parent d0d5d2d310
commit a47cbab211
6 changed files with 3 additions and 23 deletions

View File

@ -12,11 +12,7 @@ import {
Divider,
} from '@material-ui/core';
import useStyles from './useStyles';
import {
Dashboard as DashboardIcon,
Group as GroupIcon,
Work as WorkIcon,
} from '@material-ui/icons';
import { Group as GroupIcon, Work as WorkIcon } from '@material-ui/icons';
import Nav from './components/Nav/Nav';
import CurrentUser from './components/CurrentUser/CurrentUser';
@ -33,12 +29,6 @@ const Sidebar = ({ className, open, variant, onClose, onOpen }: Props) => {
const theme = useTheme();
const { pathname } = useLocation();
const routes: NavRoute[] = [
{
name: 'Dashboard',
to: Route.DashboardPage,
Icon: <DashboardIcon color="inherit" />,
exact: true,
},
{
name: 'Użytkownicy',
to: Route.UsersPage,

View File

@ -37,7 +37,7 @@ const TopBar = ({ className, openSidebar }: Props) => {
</Hidden>
<Hidden xsDown>
<Typography variant="h4">
<Link color="inherit" to={Route.DashboardPage}>
<Link color="inherit" to={Route.UsersPage}>
Zdam Egzamin Zawodowy
</Link>
</Typography>

View File

@ -1,6 +1,5 @@
export enum Route {
SignInPage = '/',
DashboardPage = '/dashboard',
UsersPage = '/users',
ProfessionsPage = '/professions',
}

View File

@ -1,7 +1,6 @@
import { Switch, Route as RRDRoute } from 'react-router-dom';
import { Route } from '../config/routing';
import AppLayout from 'common/AppLayout/AppLayout';
import DashboardPage from './DashboardPage/DashboardPage';
import UsersPage from './UsersPage/UsersPage';
import ProfessionsPage from './ProfessionsPage/ProfessionsPage';
@ -9,9 +8,6 @@ function AdminRoutes() {
return (
<AppLayout>
<Switch>
<RRDRoute exact path={Route.DashboardPage}>
<DashboardPage />
</RRDRoute>
<RRDRoute exact path={Route.UsersPage}>
<UsersPage />
</RRDRoute>

View File

@ -1,5 +0,0 @@
const DashboardPage = () => {
return <div>I'll add something here in the future.</div>;
};
export default DashboardPage;

View File

@ -11,7 +11,7 @@ const PublicRoute = ({ children, ...rest }: RouteProps) => {
{isNil(user) || user.role !== Role.Admin ? (
children
) : (
<Redirect to={Route.DashboardPage} />
<Redirect to={Route.UsersPage} />
)}
</RRDRoute>
);