2016-08-12 15:28:05 -07:00
|
|
|
import {
|
|
|
|
modernChallengesRoute,
|
|
|
|
mapRoute,
|
|
|
|
challengesRoute
|
|
|
|
} from './challenges';
|
2015-11-19 22:45:31 -08:00
|
|
|
import NotFound from '../components/NotFound/index.jsx';
|
2016-06-20 21:01:14 -07:00
|
|
|
import { addLang } from '../utils/lang';
|
2016-08-12 15:28:05 -07:00
|
|
|
import settingsRoute from './settings';
|
2015-07-03 17:40:12 -07:00
|
|
|
|
2016-08-12 15:28:05 -07:00
|
|
|
export default function createChildRoute(deps) {
|
|
|
|
return {
|
|
|
|
path: '/:lang',
|
|
|
|
indexRoute: {
|
|
|
|
onEnter(nextState, replace) {
|
|
|
|
const { lang } = nextState.params;
|
|
|
|
const { pathname } = nextState.location;
|
|
|
|
replace(addLang(pathname, lang));
|
|
|
|
}
|
|
|
|
},
|
|
|
|
childRoutes: [
|
|
|
|
challengesRoute(deps),
|
|
|
|
modernChallengesRoute(deps),
|
|
|
|
mapRoute(deps),
|
|
|
|
settingsRoute(deps),
|
|
|
|
{
|
|
|
|
path: '*',
|
|
|
|
component: NotFound
|
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
|
|
|
}
|