diff --git a/js/app.js b/js/app.js index 6115a0aa..6dcf58bf 100644 --- a/js/app.js +++ b/js/app.js @@ -65,12 +65,15 @@ class AppGateway { load(settings) { let type = 'default'; + let subdomain = 'www'; + if (settings) { type = settings.type; + subdomain = settings.subdomain; } EventActions.applicationWillBoot(settings); - Router.run(getRoutes(type), Router.HistoryLocation, (App) => { + Router.run(getRoutes(type, subdomain), Router.HistoryLocation, (App) => { React.render( , document.getElementById('main') diff --git a/js/components/whitelabel/wallet/components/wallet_register_piece.js b/js/components/whitelabel/wallet/components/cyland/cyland_register_piece.js similarity index 81% rename from js/components/whitelabel/wallet/components/wallet_register_piece.js rename to js/components/whitelabel/wallet/components/cyland/cyland_register_piece.js index 6b4d88fa..a5ff79b3 100644 --- a/js/components/whitelabel/wallet/components/wallet_register_piece.js +++ b/js/components/whitelabel/wallet/components/cyland/cyland_register_piece.js @@ -1,15 +1,15 @@ 'use strict'; import React from 'react'; -import RegisterPiece from '../../../register_piece'; -import Property from '../../../ascribe_forms/property'; -import InputTextAreaToggable from '../../../ascribe_forms/input_textarea_toggable'; -import InputCheckbox from '../../../ascribe_forms/input_checkbox'; +import RegisterPiece from '../../../../register_piece'; +import Property from '../../../../ascribe_forms/property'; +import InputTextAreaToggable from '../../../../ascribe_forms/input_textarea_toggable'; +import InputCheckbox from '../../../../ascribe_forms/input_checkbox'; -import { getLangText } from '../../../../utils/lang_utils'; +import { getLangText } from '../../../../../utils/lang_utils'; -let WalletRegisterPiece = React.createClass({ +let CylandRegisterPiece = React.createClass({ render() { return ( - + - + - ); + ), + 'cc': ( + + + + + + + + + + + + + + ) +}; + + +function getRoutes(commonRoutes, subdomain) { + if(subdomain in ROUTES) { + return ROUTES[subdomain]; + } else { + throw new Error('Subdomain wasn\'t specified in the wallet app.'); + } } diff --git a/js/routes.js b/js/routes.js index 4ee71070..65dfbaac 100644 --- a/js/routes.js +++ b/js/routes.js @@ -43,13 +43,13 @@ const COMMON_ROUTES = ( ); -function getRoutes(type) { +function getRoutes(type, subdomain) { let routes = null; if (type === 'prize') { - routes = getPrizeRoutes(COMMON_ROUTES); + routes = getPrizeRoutes(COMMON_ROUTES, subdomain); } else if(type === 'wallet') { - routes = getWalletRoutes(COMMON_ROUTES); + routes = getWalletRoutes(COMMON_ROUTES, subdomain); } else { routes = getDefaultRoutes(COMMON_ROUTES); }