mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 09:23:13 +01:00
Restore baseUrl in router
This commit is contained in:
parent
dc97517d65
commit
7c231a4c5e
@ -17,16 +17,13 @@ import CoaVerifyContainer from '../../../components/coa_verify_container';
|
||||
import ErrorNotFoundPage from '../../../components/error_not_found_page';
|
||||
|
||||
import App from './prize_app';
|
||||
import AppConstants from '../../../constants/application_constants';
|
||||
|
||||
import AuthProxyHandler from '../../../components/ascribe_routes/proxy_routes/auth_proxy_handler';
|
||||
|
||||
|
||||
let baseUrl = AppConstants.baseUrl;
|
||||
|
||||
function getRoutes() {
|
||||
return (
|
||||
<Route path={baseUrl} component={App}>
|
||||
<Route path='/' component={App}>
|
||||
<IndexRoute component={Landing} />
|
||||
<Route
|
||||
path='login'
|
||||
|
@ -33,14 +33,11 @@ import CCRegisterPiece from './components/cc/cc_register_piece';
|
||||
import AuthProxyHandler from '../../../components/ascribe_routes/proxy_routes/auth_proxy_handler';
|
||||
|
||||
import WalletApp from './wallet_app';
|
||||
import AppConstants from '../../../constants/application_constants';
|
||||
|
||||
|
||||
let baseUrl = AppConstants.baseUrl;
|
||||
|
||||
let ROUTES = {
|
||||
'cyland': (
|
||||
<Route path={baseUrl} component={WalletApp}>
|
||||
<Route path='/' component={WalletApp}>
|
||||
<IndexRoute component={CylandLanding} />
|
||||
<Route
|
||||
path='login'
|
||||
@ -75,7 +72,7 @@ let ROUTES = {
|
||||
</Route>
|
||||
),
|
||||
'cc': (
|
||||
<Route path={baseUrl} component={WalletApp}>
|
||||
<Route path='/' component={WalletApp}>
|
||||
<Route
|
||||
path='login'
|
||||
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(LoginContainer)} />
|
||||
@ -109,7 +106,7 @@ let ROUTES = {
|
||||
</Route>
|
||||
),
|
||||
'ikonotv': (
|
||||
<Route path={baseUrl} component={WalletApp}>
|
||||
<Route path='/' component={WalletApp}>
|
||||
<IndexRoute component={IkonotvLanding} />
|
||||
<Route
|
||||
path='login'
|
||||
|
@ -1,5 +1,13 @@
|
||||
'use strict';
|
||||
|
||||
import useBasename from 'history/lib/useBasename';
|
||||
import createBrowserHistory from 'history/lib/createBrowserHistory';
|
||||
import AppConstants from './constants/application_constants';
|
||||
|
||||
export default createBrowserHistory();
|
||||
|
||||
// Remove the trailing slash if present
|
||||
let baseUrl = AppConstants.baseUrl.replace(/\/$/, '');
|
||||
|
||||
export default useBasename(createBrowserHistory)({
|
||||
basename: baseUrl
|
||||
});
|
||||
|
@ -33,7 +33,7 @@ import AppConstants from './constants/application_constants';
|
||||
let baseUrl = AppConstants.baseUrl;
|
||||
|
||||
let COMMON_ROUTES = (
|
||||
<Route path={baseUrl} component={App}>
|
||||
<Route path='/' component={App}>
|
||||
<Route
|
||||
path="login"
|
||||
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(LoginContainer)} />
|
||||
|
Loading…
Reference in New Issue
Block a user