Skip to content

Commit 55ca2c9

Browse files
committed
Code clean-up
1 parent 77ed715 commit 55ca2c9

File tree

3 files changed

+34
-43
lines changed

3 files changed

+34
-43
lines changed

src/Dashboard/Dashboard.tsx

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from 'react'
22
import clsx from 'clsx'
3-
import { Switch, Route, Redirect, RouteComponentProps } from 'react-router-dom'
43

54
import { makeStyles, useTheme } from '@material-ui/core/styles'
65
import useMediaQuery from '@material-ui/core/useMediaQuery'
@@ -12,26 +11,7 @@ import Header from './_common/TheHeader/Header'
1211
import Sidebar from './_common/TheSidebar/Sidebar'
1312
import Footer from './_common/TheFooter'
1413

15-
// Import application core modules
16-
import Sales from './Sales'
17-
import Content from './Content'
18-
import Admin from './Admin'
19-
20-
import Profile from './Profile'
21-
import Organization from './Organization'
22-
import NotFound from './NotFound'
23-
import Demo from './Demo'
24-
25-
// import Orders from './Sales/Orders/Orders'
26-
// import Customers from './Sales/Customers/Customers'
27-
// import Reports from './Reports/Reports'
28-
29-
// Demo pages
30-
// import Components from './Demo/Components/Components'
31-
// import Features from './Demo/Features/Features'
32-
// import Docs from './Demo/Docs/Docs'
33-
// import Supporters from './Demo/Supporters/Supporters'
34-
// import Discuss from './Demo/Discuss/Discuss'
14+
import DashboardRouter from './DashboardRouter'
3515

3616
export interface DashboardProps {}
3717

@@ -125,25 +105,7 @@ export default function Dashboard() {
125105
</div>
126106
<main className={classes.content}>
127107
<div className={classes.headerSpacer} />
128-
<Switch>
129-
<Route exact path="/" render={() => <Redirect to="/sales/dashboard" />} />
130-
<Route path={`/sales`} component={Sales} />
131-
<Route path={`/content`} component={Content} />
132-
<Route path={`/admin`} component={Admin} />
133-
<Route path={`/profile`} component={Profile} />
134-
<Route path={`/account`} component={Organization} />
135-
<Route path={`/demo`} component={Demo} />
136-
<Route component={NotFound} />
137-
138-
{/* <Route path={`${match.url}/`} component={Main} />
139-
<Route path={`${match.url}orders/`} component={Orders} />
140-
<Route path={`${match.url}customers/`} component={Customers} />
141-
<Route path={`${match.url}demo/components/`} component={Components} />
142-
<Route path={`${match.url}demo/features/`} component={Features} />
143-
<Route path={`${match.url}demo/docs/`} component={Docs} />
144-
<Route path={`${match.url}demo/supporters/`} component={Supporters} />
145-
<Route path={`${match.url}demo/discuss/`} component={Discuss} /> */}
146-
</Switch>
108+
<DashboardRouter />
147109
<Footer />
148110
</main>
149111
</div>

src/Dashboard/DashboardRouter.tsx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import React from 'react'
2+
import { Switch, Route, Redirect } from 'react-router-dom'
3+
4+
// Import application modules
5+
import Sales from './Sales'
6+
import Content from './Content'
7+
import Admin from './Admin'
8+
9+
// Import core modules
10+
import Profile from './Profile'
11+
import Organization from './Organization'
12+
import NotFound from './NotFound'
13+
14+
// Theme demo module
15+
import Demo from './Demo'
16+
17+
const DashboardRouter = () => {
18+
return (
19+
<Switch>
20+
<Route exact path="/" render={() => <Redirect to="/sales/dashboard" />} />
21+
<Route path={`/sales`} component={Sales} />
22+
<Route path={`/content`} component={Content} />
23+
<Route path={`/admin`} component={Admin} />
24+
<Route path={`/profile`} component={Profile} />
25+
<Route path={`/account`} component={Organization} />
26+
<Route path={`/demo`} component={Demo} />
27+
<Route component={NotFound} />
28+
</Switch>
29+
)
30+
}
31+
32+
export default DashboardRouter

src/Dashboard/DashboardService.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)