Theming: Make new theme exposed by ThemeContext and make new theme include v1 for compatability (to pass to useTheme) (#33207)

* WIP: Making new theme the default

* Progress

* Updates, lots of updates

* Things are working

* Fixed issues with storybook

* Fixed tests
This commit is contained in:
Torkel Ödegaard
2021-04-21 14:25:43 +02:00
committed by GitHub
parent 569fb3f112
commit 7e2bf4f6c3
111 changed files with 1505 additions and 1534 deletions
@@ -1,15 +1,15 @@
import React from 'react';
import { Button, InfoBox, Portal, stylesFactory, useTheme } from '@grafana/ui';
import { Button, InfoBox, Portal, stylesFactory, useTheme2 } from '@grafana/ui';
import { getModalStyles } from '@grafana/ui/src/components/Modal/getModalStyles';
import { css, cx } from '@emotion/css';
import { GrafanaTheme } from '@grafana/data';
import { GrafanaThemeV2 } from '@grafana/data';
interface Props {
maxConcurrentSessions?: number;
}
export const TokenRevokedModal = (props: Props) => {
const theme = useTheme();
const theme = useTheme2();
const styles = getStyles(theme);
const modalStyles = getModalStyles(theme);
@@ -50,16 +50,16 @@ export const TokenRevokedModal = (props: Props) => {
);
};
const getStyles = stylesFactory((theme: GrafanaTheme) => {
const getStyles = stylesFactory((theme: GrafanaThemeV2) => {
return {
infobox: css`
margin-bottom: 0;
`,
text: css`
margin: ${theme.spacing.sm} 0 ${theme.spacing.md};
margin: ${theme.spacing(1, 0, 2)};
`,
backdrop: css`
background-color: ${theme.colors.dashboardBg};
background-color: ${theme.palette.background.canvas};
opacity: 0.8;
`,
};