Files
progress-test/app/javascript/routes/routes.tsx
2022-10-17 09:50:24 -03:00

26 lines
1.1 KiB
TypeScript

import React from "react";
import { Switch, Route, Redirect } from "react-router-dom";
import { Profile } from "../pages/session";
import { Dashboard } from '../pages/dashboard'
import { List, New, Show, Review, Edit } from "../pages/question";
import { Assessment } from "../pages/assessment";
import { QuestionRoutePaths, SessionRoutePaths, DashboardRoutePaths, AssessmentRoutePaths } from './paths'
export const PrivateRoutes = () => (
<Switch>
<Route exact path="/">
<Redirect to={DashboardRoutePaths.index} />
</Route>
<Route exact path={DashboardRoutePaths.index} component={Dashboard} />
<Route exact path={SessionRoutePaths.show} component={Profile} />
<Route exact path={QuestionRoutePaths.index} component={List} />
<Route exact path={QuestionRoutePaths.new} component={New} />
<Route exact path={QuestionRoutePaths.show} component={Show} />
<Route exact path={QuestionRoutePaths.edit} component={Edit} />
<Route exact path={QuestionRoutePaths.review} component={Review} />
<Route exact path={AssessmentRoutePaths.index} component={Assessment} />
</Switch>
);