Copy // import external modules
import React , { Component , Suspense , lazy } from "react" ;
import { BrowserRouter , Switch , Route } from "react-router-dom" ;
import Spinner from "../components/spinner/spinner" ;
// import internal(own) modules
import MainLayoutRoute from "../layout/routes/mainLayoutRoute" ;
import { SpinnerComponent } from "../components/spinner/Spinner" ;
const Analytic = lazy (() => import ( "../views/dashboard/analytic" ));
const Sales = lazy (() => import ( "../views/dashboard/sales" ));
class Router extends Component {
render () {
return (
< BrowserRouter basename = "elite-able" >
< Switch >
< MainLayoutRoute
exact
path = "/"
title = "Home"
name = "Analytics Dashboard"
render = {matchprops => (
< Suspense fallback = {< SpinnerComponent />}>
< Analytic { ... matchprops} />
</ Suspense >
)}
/>
//Add new page route here
< MainLayoutRoute
exact
path = "/sales"
title = "Sales"
name = "Sales Dashboard"
render = {matchprops => (
< Suspense fallback = {< SpinnerComponent />}>
< Sales { ... matchprops} />
</ Suspense >
)}
/>
</ Switch >
</ BrowserRouter >
);
}
}
export default Router;
Copy import React , { Component } from "react" ;
import { NavLink , Link } from "react-router-dom" ;
import * as Icons from "react-feather" ;
import MenuHelper from "./sideMenuHelp" ;
import { Badge } from "./sideMenuHelp" ;
class Menus extends Component {
render () {
return (
< MenuHelper >
< MenuHelper.Label labelText = "Navigation" />
//Mulitiple menus
< MenuHelper.MultiMenu
name = "Dashbord"
Icon = {< Icons.Home size = { 14 } />}
defaultSelect
>
< NavLink exact to = "/" activeClassName = "active" >
Analytics
</ NavLink >
< NavLink exact to = "/sales" activeClassName = "active" >
Sales
</ NavLink >
< NavLink exact to = "/crypto" activeClassName = "active" >
Crypto
</ NavLink >
< NavLink exact to = "/project" activeClassName = "active" >
Project
</ NavLink >
< NavLink exact to = "/helpdesk" activeClassName = "active" >
Helpdesk
< Badge text = "NEW" color = "danger" />
</ NavLink >
</ MenuHelper.MultiMenu >
//Single Menu
< MenuHelper.MenuSingle path = "/app/message" icon = {< Icons.MessageCircle size = { 14 } />} text = "Message" />
</ MenuHelper >
);
}
}
export default Menus;