Files
freeCodeCamp/common/app/routes/challenges/index.js
2016-08-12 15:28:05 -07:00

30 lines
586 B
JavaScript

import Show from './components/Show.jsx';
import ShowMap from './components/map/Map.jsx';
export function challengesRoute() {
return {
path: 'challenges(/:dashedName)',
component: Show,
onEnter(nextState, replace) {
// redirect /challenges to /map
if (nextState.location.pathname === '/challenges') {
replace('/map');
}
}
};
}
export function modernChallengesRoute() {
return {
path: 'challenges/:block/:dashedName',
component: Show
};
}
export function mapRoute() {
return {
path: 'map',
component: ShowMap
};
}