Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(InputGroup): Convert input group to typescript #2220

Merged
merged 10 commits into from Jun 27, 2019

Edit formatting and remove unneeded omits

  • Loading branch information
jessiehuff committed Jun 13, 2019
commit 99e8bb3fa06081aa13ba1921492be66680f09d3f
@@ -1,16 +1,15 @@
import * as React from 'react';
import styles from '@patternfly/react-styles/css/components/InputGroup/input-group';
import { css } from '@patternfly/react-styles';
import { Omit } from '../../helpers/typeUtils'
import { FormSelect } from '../FormSelect';
import { TextArea } from '../TextArea';
import { TextInput } from '../TextInput';

export interface InputGroupProps extends Omit<React.HTMLProps<HTMLDivElement>, 'children'> {
/** Additional classes added to the input group. */
className?: string;
/** Content rendered inside the input group. */
children: React.ReactNode;
export interface InputGroupProps extends React.HTMLProps<HTMLDivElement> {
/** Additional classes added to the input group. */
className?: string;
/** Content rendered inside the input group. */
children: React.ReactNode;
}

export const InputGroup: React.FunctionComponent<InputGroupProps> = ({
@@ -9,7 +9,7 @@ export interface InputGroupTextProps extends Omit<React.HTMLProps<HTMLSpanElemen
/** Content rendered inside the input group text. */
children: React.ReactNode;
/** Component that wraps the input group text. */
component?: React.ReactNode; // componentShape
component?: React.ReactNode;
}

export const InputGroupText: React.FunctionComponent<InputGroupTextProps> = ({
@@ -18,9 +18,10 @@ export const InputGroupText: React.FunctionComponent<InputGroupTextProps> = ({
children,
...props
}: InputGroupTextProps) => {
const Component = component as any
return(
<Component className={css(styles.inputGroupText, className)} {...props}>
{children}
</Component>
)};
const Component = component as any;
return (
<Component className={css(styles.inputGroupText, className)} {...props}>
{children}
</Component>
);
};
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.