Skip to content

Commit

Permalink
EuiFormHelpText converted to TS (#1852)
Browse files Browse the repository at this point in the history
* `EuiFormHelpText` converted to TS

* `EuiFormHelpText` updated Changelog
  • Loading branch information
theodesp authored and chandlerprall committed Apr 18, 2019
1 parent 6867a63 commit 9187f1f
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 47 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- Use `cache-loader` to speed up development docs site build ([#1841](https://github.com/elastic/eui/pull/1841)
- Converted `matching_options` to TS ([#1828](https://github.com/elastic/eui/pull/1828))
- Converted `EuiFormHelpText` to TS ([#1852](https://github.com/elastic/eui/pull/1852))

**Bug fixes**

Expand Down
21 changes: 0 additions & 21 deletions src/components/form/form_help_text/form_help_text.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import React from 'react';
import { render } from 'enzyme';
import { requiredProps } from '../../../test/required_props';
import { requiredProps } from '../../../test';

import { EuiFormHelpText } from './form_help_text';

describe('EuiFormHelpText', () => {
test('is rendered', () => {
const component = render(
<EuiFormHelpText {...requiredProps}>
This is help text.
</EuiFormHelpText>
<EuiFormHelpText {...requiredProps}>This is help text.</EuiFormHelpText>
);

expect(component)
.toMatchSnapshot();
expect(component).toMatchSnapshot();
});
});
16 changes: 16 additions & 0 deletions src/components/form/form_help_text/form_help_text.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React, { FunctionComponent, HTMLAttributes } from 'react';

import classNames from 'classnames';
import { CommonProps } from '../../common';

export const EuiFormHelpText: FunctionComponent<
CommonProps & HTMLAttributes<HTMLDivElement>
> = ({ children, className, ...rest }) => {
const classes = classNames('euiFormHelpText', className);

return (
<div className={classes} {...rest}>
{children}
</div>
);
};
17 changes: 0 additions & 17 deletions src/components/form/form_help_text/index.d.ts

This file was deleted.

3 changes: 0 additions & 3 deletions src/components/form/form_help_text/index.js

This file was deleted.

1 change: 1 addition & 0 deletions src/components/form/form_help_text/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { EuiFormHelpText } from './form_help_text';

0 comments on commit 9187f1f

Please sign in to comment.