2016-06-03 17:52:38 +02:00
|
|
|
import React from 'react';
|
2016-06-06 14:54:29 +02:00
|
|
|
import Redirect from 'react-router/es6/Redirect';
|
2016-06-03 17:52:38 +02:00
|
|
|
|
|
|
|
import getWalletApiUrls from './constants/wallet_api_urls';
|
|
|
|
import getWalletRoutes from './wallet_routes';
|
|
|
|
|
2016-06-14 13:05:57 +02:00
|
|
|
import { mergeWithBaseApiUrls } from '../../../constants/api_urls';
|
2016-06-03 17:52:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
function resolve(subdomain) {
|
|
|
|
// Most whitelabels have landing pages so we should not automatically redirect from / to /collection.
|
|
|
|
// Only cc does not have a landing page.
|
|
|
|
const redirectRoute = subdomain === 'cc' ? (<Redirect from="/" to="/collection" />) : null;
|
|
|
|
|
|
|
|
return {
|
|
|
|
redirectRoute,
|
2016-06-14 13:05:57 +02:00
|
|
|
apiUrls: mergeWithBaseApiUrls(getWalletApiUrls(subdomain)),
|
2016-06-03 17:52:38 +02:00
|
|
|
routes: getWalletRoutes(subdomain)
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export default { resolve };
|