1
0
mirror of https://github.com/franjsco/tick3t synced 2024-12-28 02:11:32 +01:00

improvement: add route - logout

This commit is contained in:
Francesco Esposito 2019-07-31 16:01:46 +02:00
parent 530f22c77e
commit 09961d89cb

View File

@ -1,28 +1,25 @@
import React, { Component } from "react"; import React, { Component } from "react";
import { Container } from "reactstrap";
import { import {
BrowserRouter as Router, BrowserRouter as Router,
Route, Route,
Switch, Switch,
Redirect Redirect
} from "react-router-dom"; } from "react-router-dom";
import { Container } from "reactstrap";
import { PrivateRoute } from "./PrivateRoute"; import { PrivateRoute } from "./PrivateRoute";
import { validateUser } from "./utils/auth";
import Home from "./containers/HomePage/Home"; import Home from "./containers/HomePage/Home";
import CreateTicket from "./containers/CreateTicket/CreateTicket"; import CreateTicket from "./containers/CreateTicket/CreateTicket";
import ViewRequest from "./containers/ViewTicket/ViewTicket"; import ViewRequest from "./containers/ViewTicket/ViewTicket";
import PageNotFound from "./containers/PageNotFound"; import PageNotFound from "./containers/PageNotFound";
import Login from "./containers/Administration/Login"; import Login from "./containers/Administration/Login";
import Logout from "./containers/Logout";
import TicketList from "./containers/Administration/TicketList"; import TicketList from "./containers/Administration/TicketList";
import TicketManager from "./containers/Administration/TicketManager"; import TicketManager from "./containers/Administration/TicketManager";
class Routes extends Component { class Routes extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = {}; this.state = {};
} }
@ -42,10 +39,8 @@ class Routes extends Component {
<Route path="/login" component={Login} /> <Route path="/login" component={Login} />
<PrivateRoute path="/admin/" exact component={TicketList} /> <PrivateRoute path="/admin/" exact component={TicketList} />
<PrivateRoute <PrivateRoute path="/admin/ticket/:ticketId" component={TicketManager} />
path="/admin/ticket/:ticketId" <PrivateRoute path="/logout" component={Logout} />
component={TicketManager}
/>
<Route component={PageNotFound} /> <Route component={PageNotFound} />
</Switch> </Switch>
</Container> </Container>