1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 09:35:10 +01:00
onion/js/components/whitelabel/wallet/wallet_routes.js

103 lines
5.3 KiB
JavaScript
Raw Normal View History

'use strict';
import React from 'react';
2015-10-01 15:57:46 +02:00
import { Route, IndexRoute } from 'react-router';
2015-08-12 09:30:24 +02:00
// general components
import CoaVerifyContainer from '../../../components/coa_verify_container';
import LoginContainer from '../../../components/login_container';
import LogoutContainer from '../../../components/logout_container';
import SignupContainer from '../../../components/signup_container';
import PasswordResetContainer from '../../../components/password_reset_container';
import PieceList from '../../../components/piece_list';
import PieceContainer from '../../../components/ascribe_detail/piece_container';
import EditionContainer from '../../../components/ascribe_detail/edition_container';
import SettingsContainer from '../../../components/ascribe_settings/settings_container';
import ContractSettings from '../../../components/ascribe_settings/contract_settings';
import ErrorNotFoundPage from '../../../components/error_not_found_page';
2015-08-19 09:31:36 +02:00
import CylandLanding from './components/cyland/cyland_landing';
import CylandPieceContainer from './components/cyland/ascribe_detail/cyland_piece_container';
2015-08-12 09:30:24 +02:00
import CylandRegisterPiece from './components/cyland/cyland_register_piece';
import CylandPieceList from './components/cyland/cyland_piece_list';
import IkonotvLanding from './components/ikonotv/ikonotv_landing';
import IkonotvPieceList from './components/ikonotv/ikonotv_piece_list';
2015-10-01 15:57:46 +02:00
import ContractAgreementForm from '../../../components/ascribe_forms/form_contract_agreement';
2015-09-15 13:15:29 +02:00
import IkonotvRegisterPiece from './components/ikonotv/ikonotv_register_piece';
2015-08-28 12:33:00 +02:00
import IkonotvPieceContainer from './components/ikonotv/ascribe_detail/ikonotv_piece_container';
2015-09-04 11:49:55 +02:00
import IkonotvContractNotifications from './components/ikonotv/ikonotv_contract_notifications';
2015-08-12 09:30:24 +02:00
import CCRegisterPiece from './components/cc/cc_register_piece';
import WalletApp from './wallet_app';
import AppConstants from '../../../constants/application_constants';
let baseUrl = AppConstants.baseUrl;
let ROUTES = {
'cyland': (
<Route path={baseUrl} component={WalletApp}>
2015-10-01 15:57:46 +02:00
<IndexRoute component={CylandLanding} />
<Route path="login" component={LoginContainer} />
<Route path="logout" component={LogoutContainer} />
<Route path="signup" component={SignupContainer} />
<Route path="password_reset" component={PasswordResetContainer} />
<Route path="register_piece" component={CylandRegisterPiece} headerTitle="+ NEW WORK" />
<Route path="collection" component={CylandPieceList} headerTitle="COLLECTION" />
<Route path="pieces/:pieceId" component={CylandPieceContainer} />
<Route path="editions/:editionId" component={EditionContainer} />
<Route path="verify" component={CoaVerifyContainer} />
<Route path="settings" component={SettingsContainer} />
<Route path="contract_settings" component={ContractSettings} />
<Route path="*" component={ErrorNotFoundPage} />
</Route>
),
'cc': (
<Route path={baseUrl} component={WalletApp}>
<Route path="login" component={LoginContainer} />
<Route path="logout" component={LogoutContainer} />
<Route path="signup" component={SignupContainer} />
<Route path="password_reset" component={PasswordResetContainer} />
<Route path="register_piece" component={CCRegisterPiece} headerTitle="+ NEW WORK" />
<Route path="collection" component={PieceList} headerTitle="COLLECTION" />
<Route path="pieces/:pieceId" component={PieceContainer} />
<Route path="editions/:editionId" component={EditionContainer} />
<Route path="verify" component={CoaVerifyContainer} />
<Route path="settings" component={SettingsContainer} />
<Route path="*" component={ErrorNotFoundPage} />
</Route>
2015-08-18 12:08:01 +02:00
),
'ikonotv': (
<Route path={baseUrl} component={WalletApp}>
2015-10-01 15:57:46 +02:00
<IndexRoute component={IkonotvLanding} />
<Route path="login" component={LoginContainer} />
<Route path="logout" component={LogoutContainer} />
<Route path="signup" component={SignupContainer} />
<Route path="password_reset" component={PasswordResetContainer} />
2015-10-01 15:57:46 +02:00
<Route path="request_loan" component={ContractAgreementForm} headerTitle="SEND NEW CONTRACT" aclName="acl_create_contractagreement" />
<Route path="register_piece" component={IkonotvRegisterPiece} headerTitle="+ NEW WORK" aclName="acl_create_piece"/>
<Route path="collection" component={IkonotvPieceList} headerTitle="COLLECTION"/>
<Route path="pieces/:pieceId" component={IkonotvPieceContainer} />
<Route path="editions/:editionId" component={EditionContainer} />
<Route path="verify" component={CoaVerifyContainer} />
<Route path="settings" component={SettingsContainer} />
<Route path="contract_settings" component={ContractSettings} />
<Route path="contract_notifications" component={IkonotvContractNotifications} />
<Route path="*" component={ErrorNotFoundPage} />
2015-08-18 12:08:01 +02:00
</Route>
)
};
function getRoutes(commonRoutes, subdomain) {
if(subdomain in ROUTES) {
return ROUTES[subdomain];
} else {
throw new Error('Subdomain wasn\'t specified in the wallet app.');
}
}
export default getRoutes;