Skip to content

Commit

Permalink
feat(Label): Convert Label to TypeScript
Browse files Browse the repository at this point in the history
Fixes #1893
  • Loading branch information
rebeccaalpert committed Apr 30, 2019
1 parent c5bbc00 commit c13ba78
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 41 deletions.
10 changes: 0 additions & 10 deletions packages/patternfly-4/react-core/src/components/Label/Label.d.ts

This file was deleted.

28 changes: 0 additions & 28 deletions packages/patternfly-4/react-core/src/components/Label/Label.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { shallow } from 'enzyme';
import Label from './Label';
import { Label } from './Label';

test('label', () => {
const view = shallow(<Label>Something</Label>);
Expand Down
20 changes: 20 additions & 0 deletions packages/patternfly-4/react-core/src/components/Label/Label.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import * as React from 'react';
import styles from '@patternfly/patternfly/components/Label/label.css';
import { css } from '@patternfly/react-styles';

export interface LabelProps extends React.HTMLProps<HTMLSpanElement> {
children: React.ReactNode;
className?: string;
isCompact?: boolean;
}

export const Label: React.FunctionComponent<LabelProps> = ({
children,
className = '',
isCompact = false,
...props
}) => (
<span {...props} className={css(styles.label, className, isCompact && styles.modifiers.compact)}>
{children}
</span>
);

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Label } from './Label';

0 comments on commit c13ba78

Please sign in to comment.