FormField: removes theme model since its not used in styles (#33632)

This commit is contained in:
Uchechukwu Obasi 2021-05-04 15:46:32 +01:00 committed by GitHub
parent 0006765a40
commit 43fd829565
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,9 +1,7 @@
import React, { InputHTMLAttributes, FunctionComponent } from 'react'; import React, { InputHTMLAttributes, FunctionComponent } from 'react';
import { css, cx } from '@emotion/css'; import { css, cx } from '@emotion/css';
import { GrafanaTheme } from '@grafana/data';
import { InlineFormLabel } from '../FormLabel/FormLabel'; import { InlineFormLabel } from '../FormLabel/FormLabel';
import { PopoverContent } from '../Tooltip/Tooltip'; import { PopoverContent } from '../Tooltip/Tooltip';
import { useStyles } from '../../themes';
export interface Props extends InputHTMLAttributes<HTMLInputElement> { export interface Props extends InputHTMLAttributes<HTMLInputElement> {
label: string; label: string;
@ -32,7 +30,7 @@ export const FormField: FunctionComponent<Props> = ({
className, className,
...inputProps ...inputProps
}) => { }) => {
const styles = useStyles(getStyles); const styles = getStyles();
return ( return (
<div className={cx(styles.formField, className)}> <div className={cx(styles.formField, className)}>
<InlineFormLabel width={labelWidth} tooltip={tooltip}> <InlineFormLabel width={labelWidth} tooltip={tooltip}>
@ -48,7 +46,7 @@ export const FormField: FunctionComponent<Props> = ({
FormField.displayName = 'FormField'; FormField.displayName = 'FormField';
FormField.defaultProps = defaultProps; FormField.defaultProps = defaultProps;
const getStyles = (theme: GrafanaTheme) => { const getStyles = () => {
return { return {
formField: css` formField: css`
display: flex; display: flex;