Files
freeCodeCamp/common/app/routes/challenges/index.js
2016-07-28 23:39:17 -07:00

24 lines
494 B
JavaScript

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