mirror of
https://github.com/SomboChea/ui
synced 2024-11-05 14:14:26 +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> {
|
export default class App extends Component<{}, AppStateInterface> {
|
||||||
public state: AppStateInterface = {
|
public state: AppStateInterface = {
|
||||||
// @ts-ignore
|
|
||||||
logoUrl: window.VERDACCIO_LOGO,
|
logoUrl: window.VERDACCIO_LOGO,
|
||||||
user: {},
|
user: {},
|
||||||
// @ts-ignore
|
scope: window.VERDACCIO_SCOPE || '',
|
||||||
scope: window.VERDACCIO_SCOPE ? `${window.VERDACCIO_SCOPE}:` : '',
|
|
||||||
showLoginModal: false,
|
showLoginModal: false,
|
||||||
isUserLoggedIn: false,
|
isUserLoggedIn: false,
|
||||||
packages: [],
|
packages: [],
|
||||||
|
@ -10,10 +10,8 @@ jest.mock('../../../package.json', () => ({
|
|||||||
describe('<Footer /> component', () => {
|
describe('<Footer /> component', () => {
|
||||||
let wrapper;
|
let wrapper;
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
// @ts-ignore : Property 'VERDACCIO_VERSION' does not exist on type 'Window'
|
|
||||||
window.VERDACCIO_VERSION = 'v.1.0.0';
|
window.VERDACCIO_VERSION = 'v.1.0.0';
|
||||||
wrapper = mount(<Footer />);
|
wrapper = mount(<Footer />);
|
||||||
// @ts-ignore : Property 'VERDACCIO_VERSION' does not exist on type 'Window'
|
|
||||||
delete window.VERDACCIO_VERSION;
|
delete window.VERDACCIO_VERSION;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -30,7 +30,6 @@ const colors = {
|
|||||||
// Main colors
|
// Main colors
|
||||||
// -------------------------
|
// -------------------------
|
||||||
|
|
||||||
// @ts-ignore
|
|
||||||
primary: window.VERDACCIO_PRIMARY_COLOR || '#4b5e40',
|
primary: window.VERDACCIO_PRIMARY_COLOR || '#4b5e40',
|
||||||
secondary: '#20232a',
|
secondary: '#20232a',
|
||||||
};
|
};
|
||||||
|
@ -7,6 +7,10 @@ export interface VerdaccioOptions {
|
|||||||
declare global {
|
declare global {
|
||||||
interface Window {
|
interface Window {
|
||||||
__VERDACCIO_BASENAME_UI_OPTIONS: VerdaccioOptions;
|
__VERDACCIO_BASENAME_UI_OPTIONS: VerdaccioOptions;
|
||||||
|
VERDACCIO_PRIMARY_COLOR: string;
|
||||||
|
VERDACCIO_LOGO: string;
|
||||||
|
VERDACCIO_SCOPE: string;
|
||||||
|
VERDACCIO_VERSION: string;
|
||||||
VERDACCIO_API_URL: string;
|
VERDACCIO_API_URL: string;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user