mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Publisher: added default child route
This commit is contained in:
parent
f5c1eea6fa
commit
9f402d5f91
@ -18,7 +18,8 @@
|
||||
"react-highlight-words": "^0.16.0",
|
||||
"react-router-config": "^5.0.0",
|
||||
"react-router-dom": "latest",
|
||||
"react-scripts": "2.1.8"
|
||||
"react-scripts": "2.1.8",
|
||||
"react-router": "latest"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.0.0",
|
||||
|
||||
@ -13,19 +13,19 @@ import {Provider} from "react-redux";
|
||||
|
||||
const routes = [
|
||||
{
|
||||
path: '/publisher/Login',
|
||||
path: '/publisher/login',
|
||||
component: Login
|
||||
},
|
||||
{
|
||||
path: '/publisher/application-mgt',
|
||||
path: '/publisher',
|
||||
component: Dashboard,
|
||||
routes: [
|
||||
{
|
||||
path: '/publisher/application-mgt/apps',
|
||||
path: '/publisher/apps',
|
||||
component: Apps
|
||||
},
|
||||
{
|
||||
path: '/publisher/application-mgt/new-app',
|
||||
path: '/publisher/new-app',
|
||||
component: AddNewApp
|
||||
}
|
||||
]
|
||||
|
||||
@ -43,12 +43,8 @@ class NormalLoginForm extends React.Component {
|
||||
inValid: false,
|
||||
loading : false
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
handleSubmit = (e) => {
|
||||
const thisForm = this;
|
||||
e.preventDefault();
|
||||
|
||||
@ -7,6 +7,7 @@ import styles from './Dashboard.less';
|
||||
import Logo from "../../../public/images/logo.svg";
|
||||
import {Link, NavLink} from "react-router-dom";
|
||||
import RouteWithSubRoutes from "../../components/RouteWithSubRoutes"
|
||||
import { Switch, Redirect } from 'react-router'
|
||||
|
||||
|
||||
class Dashboard extends React.Component {
|
||||
@ -36,10 +37,14 @@ class Dashboard extends React.Component {
|
||||
</Menu>
|
||||
</Header>
|
||||
<Content style={{padding: '0 0'}}>
|
||||
<Switch>
|
||||
<Redirect exact from="/publisher" to="/publisher/apps"/>
|
||||
{this.state.routes.map((route) => (
|
||||
<RouteWithSubRoutes key={route.path} {...route} />
|
||||
))}
|
||||
|
||||
</Switch>
|
||||
|
||||
</Content>
|
||||
<Footer style={{textAlign: 'center'}}>
|
||||
©2019 entgra.io
|
||||
|
||||
Loading…
Reference in New Issue
Block a user