mirror of
https://github.com/SomboChea/ui
synced 2024-11-24 06:54:27 +07:00
fix: add new window property to interface definition
This commit is contained in:
parent
7a8b158188
commit
b35baa069f
@ -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: [],
|
||||
|
@ -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;
|
||||
});
|
||||
|
||||
|
@ -30,7 +30,6 @@ const colors = {
|
||||
// Main colors
|
||||
// -------------------------
|
||||
|
||||
// @ts-ignore
|
||||
primary: window.VERDACCIO_PRIMARY_COLOR || '#4b5e40',
|
||||
secondary: '#20232a',
|
||||
};
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user