Skip to content

Commit

Permalink
FIX: NotificationBadge children requirement (#1125)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomashapl authored and vepor committed Jul 17, 2019
1 parent bfbd806 commit 3af699f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Badge/README.md
Expand Up @@ -12,7 +12,7 @@ Table below contains all types of the props available in Badge component.

| Name | Type | Default | Description |
| :------------ | :---------------------| :-------------- | :------------------------------- |
| **children** | `React.Node` | | The content of the Badge.
| children | `React.Node` | | The content of the Badge.
| dataTest | `string` | | Optional prop for testing purposes.
| icon | `React.Node` | | The displayed icon on the left.
| type | [`enum`](#enum) | `"neutral"` | The color type of the Badge.
Expand Down
2 changes: 1 addition & 1 deletion src/Badge/index.js.flow
Expand Up @@ -18,7 +18,7 @@ export type Type =
| "criticalInverted";

export type Props = {|
+children: React$Node,
+children?: React$Node,
+type?: Type,
+icon?: React$Node,
+ariaLabel?: string,
Expand Down
8 changes: 7 additions & 1 deletion src/NotificationBadge/NotificationBadge.stories.js
Expand Up @@ -126,9 +126,15 @@ storiesOf("NotificationBadge", module)
const type = select("Type", Object.values(TYPE_OPTIONS), TYPE_OPTIONS.INFO);
const dataTest = text("dataTest", "test");
const ariaLabel = text("ariaLabel", "additional information for screen readers");
const Icon = getIcon(getIcons("Airplane"));

return (
<NotificationBadge type={type} dataTest={dataTest} ariaLabel={ariaLabel}>
<NotificationBadge
type={type}
dataTest={dataTest}
ariaLabel={ariaLabel}
icon={Icon && <Icon />}
>
{content}
</NotificationBadge>
);
Expand Down
2 changes: 1 addition & 1 deletion src/NotificationBadge/README.md
Expand Up @@ -12,7 +12,7 @@ Table below contains all types of the props available in NotificationBadge compo

| Name | Type | Default | Description |
| :------------ | :---------------------| :-------------- | :------------------------------- |
| **children** | `React.Node` | | The content of the NotificationBadge.
| children | `React.Node` | | The content of the NotificationBadge.
| dataTest | `string` | | Optional prop for testing purposes.
| icon | `React.Node` | | The displayed icon on the left.
| type | [`enum`](#enum) | `"neutral"` | The color type of the NotificationBadge.
Expand Down
2 changes: 1 addition & 1 deletion src/NotificationBadge/index.js.flow
Expand Up @@ -7,7 +7,7 @@ import type { Globals } from "../common/common.js.flow";
import type { Type } from "../Badge/index.js.flow";

export type Props = {|
+children: React$Node,
+children?: React$Node,
+type?: Type,
+icon?: React$Node,
+ariaLabel?: string,
Expand Down

0 comments on commit 3af699f

Please sign in to comment.