Skip to content
This repository has been archived by the owner on Jan 16, 2022. It is now read-only.

Commit

Permalink
fix: add new window property to interface definition
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine Chalifour authored and antoinechalifour committed Oct 6, 2019
1 parent 7a8b158 commit b35baa0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/App/App.tsx
Expand Up @@ -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: [],
Expand Down
2 changes: 0 additions & 2 deletions src/components/Footer/Footer.test.tsx
Expand Up @@ -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;
});

Expand Down
1 change: 0 additions & 1 deletion src/utils/styles/colors.ts
Expand Up @@ -30,7 +30,6 @@ const colors = {
// Main colors
// -------------------------

// @ts-ignore
primary: window.VERDACCIO_PRIMARY_COLOR || '#4b5e40',
secondary: '#20232a',
};
Expand Down
4 changes: 4 additions & 0 deletions types/index.ts
Expand Up @@ -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;
}
}

0 comments on commit b35baa0

Please sign in to comment.