1
0
mirror of https://github.com/ascribe/onion.git synced 2025-01-05 19:25:42 +01:00
onion/js/components/whitelabel/wallet/wallet_app_resolver.js
Brett Sun d1dfdbdbec Only import what we need from react-router
Unfortunately webpack doesn’t understand jsnext:main declarations yet,
so we have to do this ourselves by using react-router’s es6 build
2016-06-06 16:07:47 +02:00

23 lines
705 B
JavaScript

import React from 'react';
import Redirect from 'react-router/es6/Redirect';
import getWalletApiUrls from './constants/wallet_api_urls';
import getWalletRoutes from './wallet_routes';
import { updateApiUrls } from '../../../constants/api_urls';
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: updateApiUrls(getWalletApiUrls(subdomain)),
routes: getWalletRoutes(subdomain)
};
}
export default { resolve };