1
0
mirror of https://github.com/SomboChea/ui synced 2024-11-05 06:04:28 +07:00

refactor: remove getBaseNamePath() and history.ts

This commit is contained in:
Griffithtp 2019-07-14 12:35:57 +01:00
parent 795544a14c
commit ecc4521314
3 changed files with 5 additions and 17 deletions

View File

@ -1,8 +0,0 @@
import { createBrowserHistory } from 'history';
import { getBaseNamePath } from './utils/url';
const history = createBrowserHistory({
basename: getBaseNamePath(),
});
export default history;

View File

@ -2,12 +2,16 @@
import React, { Component, ReactElement } from 'react';
import { Router, Route, Switch } from 'react-router-dom';
import { createBrowserHistory } from 'history';
import { AppContextConsumer, AppStateInterface } from './App/App';
import { asyncComponent } from './utils/asyncComponent';
import history from './history';
import Header from './components/Header';
const history = createBrowserHistory({
basename: window.__VERDACCIO_BASENAME_UI_OPTIONS && window.__VERDACCIO_BASENAME_UI_OPTIONS.url_prefix,
});
const NotFound = asyncComponent(() => import('./components/NotFound'));
const VersionPackage = asyncComponent(() => import('./pages/version/Version'));
const HomePage = asyncComponent(() => import('./pages/home'));

View File

@ -18,11 +18,3 @@ export function getRegistryURL(): string {
// Don't add slash if it's not a sub directory
return `${location.origin}${location.pathname === '/' ? '' : location.pathname}`;
}
export function getBaseNamePath(): string {
return window.__VERDACCIO_BASENAME_UI_OPTIONS && window.__VERDACCIO_BASENAME_UI_OPTIONS.url_prefix;
}
export function getRootPath(): string {
return window.__VERDACCIO_BASENAME_UI_OPTIONS && window.__VERDACCIO_BASENAME_UI_OPTIONS.base;
}