1
0
mirror of https://github.com/ascribe/onion.git synced 2025-01-07 04:04:20 +01:00
onion/js/components/whitelabel/wallet/wallet_app_resolver.js

23 lines
719 B
JavaScript
Raw Permalink Normal View History

2016-06-03 17:52:38 +02:00
import React from 'react';
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';
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,
apiUrls: mergeWithBaseApiUrls(getWalletApiUrls(subdomain)),
2016-06-03 17:52:38 +02:00
routes: getWalletRoutes(subdomain)
};
}
export default { resolve };