forgeplus-react/src/forge/Main/CoderRootIndex.js

56 lines
1.6 KiB
JavaScript
Raw Normal View History

2020-03-16 14:12:11 +08:00
import React , { Component } from 'react';
import { Route , Switch , Link} from 'react-router-dom';
import Loadable from 'react-loadable';
import Loading from '../../Loading';
const CoderRootDirectory = Loadable({
loader: () => import('./CoderRootDirectory'),
loading: Loading,
})
const CoderRootCommit = Loadable({
loader: () => import('./CoderRootCommit'),
loading: Loading,
})
const CoderRootFileDetail = Loadable({
loader: () => import('./CoderRootFileDetail'),
loading: Loading,
})
const CoderRootBranch = Loadable({
loader: () => import('./CoderRootBranch'),
loading: Loading,
})
class CoderRootIndex extends Component{
render(){
return(
<div className="main">
<Switch {...this.props}>
2020-03-20 16:49:41 +08:00
<Route path="/projects/:projectsId/:author/coder/commit"
2020-03-16 14:12:11 +08:00
render={
(props) => (<CoderRootCommit {...this.props} {...props} {...this.state} />)
}
></Route>
2020-03-20 16:49:41 +08:00
<Route path="/projects/:projectsId/:author/coder/branch"
2020-03-16 14:12:11 +08:00
render={
(props) => (<CoderRootBranch {...this.props} {...props} {...this.state} />)
}
></Route>
2020-03-20 16:49:41 +08:00
<Route path="/projects/:projectsId/:author/coder"
2020-03-16 14:12:11 +08:00
render={
(props) => (<CoderRootDirectory {...this.props} {...props} {...this.state} />)
}
></Route>
2020-03-20 16:49:41 +08:00
<Route path="/projects/:projectsId/:author"
2020-03-16 14:12:11 +08:00
render={
(props) => (<CoderRootDirectory {...this.props} {...props} {...this.state} />)
}
></Route>
</Switch>
</div>
)
}
}
export default CoderRootIndex;