renaming after pr feedback

This commit is contained in:
Peter Holmberg
2019-01-16 13:46:57 +00:00
parent 83fbf52aac
commit 4c40274313
8 changed files with 23 additions and 23 deletions

View File

@@ -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', () => {

View File

@@ -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 };

View File

@@ -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,

View File

@@ -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';