improvement: change layout name in routes

This commit is contained in:
canove
2020-09-26 14:35:37 -03:00
parent d86a79a337
commit 8f5aab598d
2 changed files with 5 additions and 5 deletions

View File

@@ -102,7 +102,7 @@ const useStyles = makeStyles(theme => ({
},
}));
const MainDrawer = ({ appTitle, children }) => {
const LoggedInLayout = ({ appTitle, children }) => {
const drawerState = localStorage.getItem("drawerOpen");
const userId = +localStorage.getItem("userId");
const classes = useStyles();
@@ -241,4 +241,4 @@ const MainDrawer = ({ appTitle, children }) => {
);
};
export default MainDrawer;
export default LoggedInLayout;

View File

@@ -2,7 +2,7 @@ import React from "react";
import { BrowserRouter, Switch } from "react-router-dom";
import { ToastContainer } from "react-toastify";
import MainDrawer from "../components/_layout";
import LoggedInLayout from "../components/_layout";
import Dashboard from "../pages/Dashboard/";
import Tickets from "../pages/Tickets/";
import Signup from "../pages/Signup/";
@@ -21,7 +21,7 @@ const Routes = () => {
<Switch>
<Route exact path="/login" component={Login} />
<Route exact path="/signup" component={Signup} />
<MainDrawer>
<LoggedInLayout>
<Route exact path="/" component={Dashboard} isPrivate />
<Route
exact
@@ -38,7 +38,7 @@ const Routes = () => {
<Route exact path="/contacts" component={Contacts} isPrivate />
<Route exact path="/users" component={Users} isPrivate />
<Route exact path="/Settings" component={Settings} isPrivate />
</MainDrawer>
</LoggedInLayout>
</Switch>
<ToastContainer autoClose={3000} />
</AuthProvider>