2015-07-10 16:43:35 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
import React from 'react';
|
2015-10-09 15:19:24 +02:00
|
|
|
import { Route, IndexRoute } from 'react-router';
|
2015-07-10 16:43:35 +02:00
|
|
|
|
2015-08-11 14:47:28 +02:00
|
|
|
import Landing from './components/prize_landing';
|
|
|
|
import LoginContainer from './components/prize_login_container';
|
2015-07-17 15:02:44 +02:00
|
|
|
import LogoutContainer from '../../../components/logout_container';
|
2015-08-11 14:47:28 +02:00
|
|
|
import SignupContainer from './components/prize_signup_container';
|
2015-07-13 19:53:16 +02:00
|
|
|
import PasswordResetContainer from '../../../components/password_reset_container';
|
2015-08-11 14:47:28 +02:00
|
|
|
import PrizeRegisterPiece from './components/prize_register_piece';
|
|
|
|
import PrizePieceList from './components/prize_piece_list';
|
|
|
|
import PrizePieceContainer from './components/ascribe_detail/prize_piece_container';
|
2015-07-13 23:29:07 +02:00
|
|
|
import EditionContainer from '../../ascribe_detail/edition_container';
|
2015-08-11 14:47:28 +02:00
|
|
|
import SettingsContainer from './components/prize_settings_container';
|
2015-09-25 11:54:12 +02:00
|
|
|
import CoaVerifyContainer from '../../../components/coa_verify_container';
|
2015-09-29 16:00:58 +02:00
|
|
|
import ErrorNotFoundPage from '../../../components/error_not_found_page';
|
2015-07-10 16:43:35 +02:00
|
|
|
|
2015-08-11 14:47:28 +02:00
|
|
|
import App from './prize_app';
|
2015-07-10 16:43:35 +02:00
|
|
|
import AppConstants from '../../../constants/application_constants';
|
|
|
|
|
2015-10-12 17:00:53 +02:00
|
|
|
import AuthProxyHandler from '../../../components/ascribe_routes/proxy_routes/auth_proxy_handler';
|
2015-10-09 15:19:24 +02:00
|
|
|
|
2015-07-10 16:43:35 +02:00
|
|
|
|
2015-09-30 17:09:46 +02:00
|
|
|
let baseUrl = AppConstants.baseUrl;
|
2015-07-10 16:43:35 +02:00
|
|
|
|
2015-07-31 13:44:57 +02:00
|
|
|
function getRoutes() {
|
2015-07-10 16:43:35 +02:00
|
|
|
return (
|
2015-09-30 17:09:46 +02:00
|
|
|
<Route path={baseUrl} component={App}>
|
2015-10-09 15:19:24 +02:00
|
|
|
<IndexRoute component={Landing} />
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
|
|
|
path='login'
|
2015-10-12 17:00:53 +02:00
|
|
|
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(LoginContainer)} />
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
|
|
|
path='logout'
|
2015-10-12 17:00:53 +02:00
|
|
|
component={AuthProxyHandler({to: '/', when: 'loggedOut'})(LogoutContainer)}/>
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
|
|
|
path='signup'
|
2015-10-12 17:00:53 +02:00
|
|
|
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(SignupContainer)} />
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
|
|
|
path='password_reset'
|
2015-10-12 17:00:53 +02:00
|
|
|
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(PasswordResetContainer)} />
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
|
|
|
path='settings'
|
2015-10-12 17:00:53 +02:00
|
|
|
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(SettingsContainer)}/>
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
|
|
|
path='register_piece'
|
2015-10-12 17:00:53 +02:00
|
|
|
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(PrizeRegisterPiece)}
|
2015-10-12 16:51:03 +02:00
|
|
|
headerTitle='+ NEW WORK'/>
|
|
|
|
<Route
|
|
|
|
path='collection'
|
2015-10-12 17:00:53 +02:00
|
|
|
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(PrizePieceList)}
|
2015-10-12 16:51:03 +02:00
|
|
|
headerTitle='COLLECTION'/>
|
2015-10-09 15:19:24 +02:00
|
|
|
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route path='pieces/:pieceId' component={PrizePieceContainer} />
|
|
|
|
<Route path='editions/:editionId' component={EditionContainer} />
|
|
|
|
<Route path='verify' component={CoaVerifyContainer} />
|
|
|
|
<Route path='*' component={ErrorNotFoundPage} />
|
2015-07-10 16:43:35 +02:00
|
|
|
</Route>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-10-12 16:51:03 +02:00
|
|
|
export default getRoutes;
|