mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
FieldSet: updates components with the new theme model (#33640)
This commit is contained in:
parent
907d7b71dc
commit
3b11e7318a
@ -1,7 +1,7 @@
|
||||
import React, { FC, HTMLProps } from 'react';
|
||||
import { css, cx } from '@emotion/css';
|
||||
import { GrafanaTheme } from '@grafana/data';
|
||||
import { stylesFactory, useTheme } from '../../themes';
|
||||
import { GrafanaTheme2 } from '@grafana/data';
|
||||
import { stylesFactory, useTheme2 } from '../../themes';
|
||||
import { Legend } from './Legend';
|
||||
|
||||
export interface Props extends HTMLProps<HTMLFieldSetElement> {
|
||||
@ -11,7 +11,7 @@ export interface Props extends HTMLProps<HTMLFieldSetElement> {
|
||||
}
|
||||
|
||||
export const FieldSet: FC<Props> = ({ label, children, className, ...rest }) => {
|
||||
const theme = useTheme();
|
||||
const theme = useTheme2();
|
||||
const styles = getStyles(theme);
|
||||
|
||||
return (
|
||||
@ -22,10 +22,10 @@ export const FieldSet: FC<Props> = ({ label, children, className, ...rest }) =>
|
||||
);
|
||||
};
|
||||
|
||||
const getStyles = stylesFactory((theme: GrafanaTheme) => {
|
||||
const getStyles = stylesFactory((theme: GrafanaTheme2) => {
|
||||
return {
|
||||
wrapper: css`
|
||||
margin-bottom: ${theme.spacing.formSpacingBase * 4}px;
|
||||
margin-bottom: ${theme.spacing(4)};
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
|
Loading…
Reference in New Issue
Block a user