removed app from routes

master
Tudor Stanciu 2021-07-31 02:39:50 +03:00
parent f1319614e5
commit 702c108db0
4 changed files with 23 additions and 32 deletions

View File

@ -26,14 +26,9 @@ export default function App() {
return ( return (
<HashRouter basename={process.env.PUBLIC_URL || ""}> <HashRouter basename={process.env.PUBLIC_URL || ""}>
<Switch> <Switch>
<Route exact path="/" render={() => <Redirect to="/app/dashboard" />} /> <Route exact path="/" render={() => <Redirect to="/dashboard" />} />
<Route
exact
path="/app"
render={() => <Redirect to="/app/dashboard" />}
/>
<PrivateRoute path="/app" component={Layout} />
<PublicRoute path="/login" component={Login} /> <PublicRoute path="/login" component={Login} />
<PrivateRoute path="/" component={Layout} />
<Route component={Error} /> <Route component={Error} />
</Switch> </Switch>
</HashRouter> </HashRouter>

View File

@ -31,18 +31,14 @@ const Content = () => {
> >
<div className={classes.fakeToolbar} /> <div className={classes.fakeToolbar} />
<Switch> <Switch>
<Route path="/app/dashboard" component={Dashboard} /> <Route path="/dashboard" component={Dashboard} />
<Route path="/app/typography" component={Typography} /> <Route path="/typography" component={Typography} />
<Route path="/app/tables" component={Tables} /> <Route path="/tables" component={Tables} />
<Route path="/app/notifications" component={Notifications} /> <Route path="/notifications" component={Notifications} />
<Route <Route exact path="/ui" render={() => <Redirect to="/ui/icons" />} />
exact <Route path="/ui/maps" component={Maps} />
path="/app/ui" <Route path="/ui/icons" component={Icons} />
render={() => <Redirect to="/app/ui/icons" />} <Route path="/ui/charts" component={Charts} />
/>
<Route path="/app/ui/maps" component={Maps} />
<Route path="/app/ui/icons" component={Icons} />
<Route path="/app/ui/charts" component={Charts} />
</Switch> </Switch>
<ContentFooter /> <ContentFooter />
</div> </div>

View File

@ -18,13 +18,13 @@ let menu = [
{ {
id: 0, id: 0,
label: "Dashboard", label: "Dashboard",
link: "/app/dashboard", link: "/dashboard",
icon: <DashboardIcon /> icon: <DashboardIcon />
}, },
{ {
id: 1, id: 1,
label: "Resources", label: "Resources",
link: "/app/resources", link: "/resources",
icon: <ImageIcon /> icon: <ImageIcon />
}, },
@ -33,19 +33,19 @@ let menu = [
{ {
id: 4, id: 4,
label: "Admin", label: "Admin",
link: "/app/admin", link: "/admin",
icon: <BuildIcon /> icon: <BuildIcon />
}, },
{ {
id: 5, id: 5,
label: "Settings", label: "Settings",
link: "/app/settings", link: "/settings",
icon: <SettingsIcon />, icon: <SettingsIcon />,
children: [ children: [
{ {
id: 50, id: 50,
label: "Notifications", label: "Notifications",
link: "/app/notifications", link: "/notifications",
icon: <NotificationsIcon /> icon: <NotificationsIcon />
} }
] ]
@ -53,7 +53,7 @@ let menu = [
{ {
id: 6, id: 6,
label: "Health", label: "Health",
link: "/app/health", link: "/health",
icon: <NetworkCheckIcon /> icon: <NetworkCheckIcon />
}, },
{ id: 7, type: "divider" }, { id: 7, type: "divider" },
@ -91,19 +91,19 @@ if (enableTemplateContent) {
{ {
id: 14, id: 14,
label: "Typography", label: "Typography",
link: "/app/typography", link: "/typography",
icon: <TypographyIcon /> icon: <TypographyIcon />
}, },
{ id: 15, label: "Tables", link: "/app/tables", icon: <TableIcon /> }, { id: 15, label: "Tables", link: "/tables", icon: <TableIcon /> },
{ {
id: 16, id: 16,
label: "UI Elements", label: "UI Elements",
link: "/app/ui", link: "/ui",
icon: <UIElementsIcon />, icon: <UIElementsIcon />,
children: [ children: [
{ label: "Icons", link: "/app/ui/icons" }, { label: "Icons", link: "/ui/icons" },
{ label: "Charts", link: "/app/ui/charts" }, { label: "Charts", link: "/ui/charts" },
{ label: "Maps", link: "/app/ui/maps" } { label: "Maps", link: "/ui/maps" }
] ]
}, },
{ {

View File

@ -78,7 +78,7 @@ function loginUser(dispatch, login, password, history, setIsLoading, setError) {
} }
}); });
history.push("/app/dashboard"); history.push("/dashboard");
} else { } else {
setLoginFailed(dispatch, setError, setIsLoading, "Login.EmptyCredentials"); setLoginFailed(dispatch, setError, setIsLoading, "Login.EmptyCredentials");
} }