Files
freeCodeCamp/common/app/routes/challenges/index.js

30 lines
586 B
JavaScript
Raw Normal View History

2016-05-13 22:34:40 -07:00
import Show from './components/Show.jsx';
import ShowMap from './components/map/Map.jsx';
2016-03-05 21:06:04 -08:00
export function challengesRoute() {
return {
path: 'challenges(/:dashedName)',
component: Show,
onEnter(nextState, replace) {
// redirect /challenges to /map
if (nextState.location.pathname === '/challenges') {
replace('/map');
}
2016-04-18 18:58:29 -07:00
}
};
}
export function modernChallengesRoute() {
return {
path: 'challenges/:block/:dashedName',
component: Show
};
}
2016-06-09 16:02:51 -07:00
export function mapRoute() {
return {
path: 'map',
component: ShowMap
};
}