Commit 99658852 by Dominik Prokop

Fixed failing tests because of circular dependency

parent 75e9c1e8
import React from 'react';
import { getTheme } from './index';
import { getTheme } from './getTheme';
import { GrafanaThemeType, Themeable } from '../types/theme';
type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
......
import darkTheme from './dark';
import lightTheme from './light';
import { GrafanaTheme } from '../types/theme';
let themeMock: ((name?: string) => GrafanaTheme) | null;
export const getTheme = (name?: string) =>
(themeMock && themeMock(name)) || (name === 'light' ? lightTheme : darkTheme);
export const mockTheme = (mock: (name?: string) => GrafanaTheme) => {
themeMock = mock;
return () => {
themeMock = null;
};
};
import darkTheme from './dark';
import lightTheme from './light';
import { GrafanaTheme } from '../types/theme';
import { ThemeContext, withTheme } from './ThemeContext';
import { getTheme, mockTheme } from './getTheme';
let themeMock: ((name?: string) => GrafanaTheme) | null;
export let getTheme = (name?: string) => (themeMock && themeMock(name)) || (name === 'light' ? lightTheme : darkTheme);
export const mockTheme = (mock: (name?: string) => GrafanaTheme) => {
themeMock = mock;
return () => {
themeMock = null;
};
};
export { ThemeContext, withTheme };
export { ThemeContext, withTheme, mockTheme, getTheme };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment