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

fix: add new window property to interface definition

This commit is contained in:
Antoine Chalifour 2019-10-03 13:30:01 +02:00 committed by antoinechalifour
parent 7a8b158188
commit b35baa069f
4 changed files with 5 additions and 6 deletions

View File

@ -34,11 +34,9 @@ export interface AppStateInterface {
}
export default class App extends Component<{}, AppStateInterface> {
public state: AppStateInterface = {
// @ts-ignore
logoUrl: window.VERDACCIO_LOGO,
user: {},
// @ts-ignore
scope: window.VERDACCIO_SCOPE ? `${window.VERDACCIO_SCOPE}:` : '',
scope: window.VERDACCIO_SCOPE || '',
showLoginModal: false,
isUserLoggedIn: false,
packages: [],

View File

@ -10,10 +10,8 @@ jest.mock('../../../package.json', () => ({
describe('<Footer /> component', () => {
let wrapper;
beforeEach(() => {
// @ts-ignore : Property 'VERDACCIO_VERSION' does not exist on type 'Window'
window.VERDACCIO_VERSION = 'v.1.0.0';
wrapper = mount(<Footer />);
// @ts-ignore : Property 'VERDACCIO_VERSION' does not exist on type 'Window'
delete window.VERDACCIO_VERSION;
});

View File

@ -30,7 +30,6 @@ const colors = {
// Main colors
// -------------------------
// @ts-ignore
primary: window.VERDACCIO_PRIMARY_COLOR || '#4b5e40',
secondary: '#20232a',
};

View File

@ -7,6 +7,10 @@ export interface VerdaccioOptions {
declare global {
interface Window {
__VERDACCIO_BASENAME_UI_OPTIONS: VerdaccioOptions;
VERDACCIO_PRIMARY_COLOR: string;
VERDACCIO_LOGO: string;
VERDACCIO_SCOPE: string;
VERDACCIO_VERSION: string;
VERDACCIO_API_URL: string;
}
}