mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
renaming after pr feedback
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
import { FormGroup, Props } from './FormGroup';
|
||||
import { FormField, Props } from './FormField';
|
||||
|
||||
const setup = (propOverrides?: object) => {
|
||||
const props: Props = {
|
||||
@@ -14,7 +14,7 @@ const setup = (propOverrides?: object) => {
|
||||
|
||||
Object.assign(props, propOverrides);
|
||||
|
||||
return shallow(<FormGroup {...props} />);
|
||||
return shallow(<FormField {...props} />);
|
||||
};
|
||||
|
||||
describe('Render', () => {
|
||||
@@ -1,9 +1,9 @@
|
||||
import React, { SFC } from 'react';
|
||||
import React, { InputHTMLAttributes, FunctionComponent } from 'react';
|
||||
import { Label } from '..';
|
||||
|
||||
export interface Props {
|
||||
label: string;
|
||||
inputProps: {};
|
||||
inputProps: InputHTMLAttributes<HTMLInputElement>;
|
||||
labelWidth?: number;
|
||||
inputWidth?: number;
|
||||
}
|
||||
@@ -14,7 +14,7 @@ const defaultProps = {
|
||||
inputWidth: 12,
|
||||
};
|
||||
|
||||
const FormGroup: SFC<Props> = ({ label, labelWidth, inputProps, inputWidth }) => {
|
||||
const FormField: FunctionComponent<Props> = ({ label, labelWidth, inputProps, inputWidth }) => {
|
||||
return (
|
||||
<div className="gf-form">
|
||||
<Label width={labelWidth}>{label}</Label>
|
||||
@@ -23,5 +23,5 @@ const FormGroup: SFC<Props> = ({ label, labelWidth, inputProps, inputWidth }) =>
|
||||
);
|
||||
};
|
||||
|
||||
FormGroup.defaultProps = defaultProps;
|
||||
export { FormGroup };
|
||||
FormField.defaultProps = defaultProps;
|
||||
export { FormField };
|
||||
@@ -9,7 +9,7 @@ interface Props {
|
||||
isInvalid?: boolean;
|
||||
}
|
||||
|
||||
export const GfFormLabel: SFC<Props> = ({ children, isFocused, isInvalid, className, htmlFor, ...rest }) => {
|
||||
export const FormLabel: SFC<Props> = ({ children, isFocused, isInvalid, className, htmlFor, ...rest }) => {
|
||||
const classes = classNames('gf-form-label', className, {
|
||||
'gf-form-label--is-focused': isFocused,
|
||||
'gf-form-label--is-invalid': isInvalid,
|
||||
@@ -10,8 +10,8 @@ export { NoOptionsMessage } from './Select/NoOptionsMessage';
|
||||
export { default as resetSelectStyles } from './Select/resetSelectStyles';
|
||||
|
||||
// Forms
|
||||
export { GfFormLabel } from './GfFormLabel/GfFormLabel';
|
||||
export { FormGroup } from './FormGroup/FormGroup';
|
||||
export { FormLabel } from './FormLabel/FormLabel';
|
||||
export { FormField } from './FormGroup/FormField';
|
||||
export { Label } from './Label/Label';
|
||||
|
||||
export { LoadingPlaceholder } from './LoadingPlaceholder/LoadingPlaceholder';
|
||||
|
||||
Reference in New Issue
Block a user