move move frontend to progress-test

This commit is contained in:
João Geonizeli
2022-07-21 21:16:59 -03:00
parent f8d5d08447
commit 386050d4ad
129 changed files with 159374 additions and 39 deletions

View File

@@ -0,0 +1,2 @@
export * from "./routes";
export * from "./paths";

View File

@@ -0,0 +1,18 @@
export const QuestionRoutePaths = {
index: "/questions",
new: "/questions/new",
show: "/questions/:id",
edit: "/questions/:id/edit",
review: "/questions/:id/review",
};
export const SessionRoutePaths = {
signIn: "/",
newPassword: "/password/new",
editPassword: "/password/edit",
show: "/my_user",
};
export const DashboardRoutePaths = {
index: "/dashboard",
};

View File

@@ -0,0 +1,28 @@
import React from "react";
import { Switch, Route, Redirect } from "react-router-dom";
import { Dashboard } from '../pages/dashboard'
import { List, New, Show, Review, Edit } from "../pages/question";
import { Profile, SignIn } from "../pages/session";
import { QuestionRoutePaths, SessionRoutePaths, DashboardRoutePaths } 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} />
</Switch>
);
export const PublicRoutes = () => (
<Switch>
<Route path={SessionRoutePaths.signIn} component={SignIn} />
</Switch>
);