MyRoutes.js
1.3 KB
import React, { Component, PropTypes } from 'react';
import { Router, Route, IndexRoute } from 'react-router';
import { connect } from 'react-redux';
import CoreLayout from '../layouts/CoreLayout';
import LoginContainer from '../containers/LoginContainer';
import ForgetPasswordContainer from '../containers/ForgetPasswordContainer'
import asyncComponent from './AsyncComponent';
import AssistantRoutes from './AssistantRoutes';
const ChooseTenantContainer = asyncComponent(
() => import(/* webpackChunkName: "chooseTenantContainer" */'../containers/ChooseTenantContainer')
);
export class MyRoutes extends Component {
static propTypes = {
history: PropTypes.object.isRequired
};
render() {
return (
<Router history={this.props.history} >
<Route component={CoreLayout} path='/'>
<IndexRoute component={LoginContainer} />
<Route component={LoginContainer} path='login'>
<Route component={ChooseTenantContainer} path='choose-tenant' />
<Route component={ForgetPasswordContainer} path='forget-password' />
</Route>
{[AssistantRoutes]}
</Route>
</Router>
);
}
}
export default MyRoutes