Skip to content

Commit

Permalink
Fixed example file names
Browse files Browse the repository at this point in the history
  • Loading branch information
thatblindgeye committed Jan 24, 2024
1 parent cffb89e commit a658ca3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export interface HelperTextItemProps extends React.HTMLProps<HTMLDivElement | HT
}

const defaultVariantIcons = {
default: <></>,
indeterminate: <MinusIcon />,
warning: <ExclamationTriangleIcon />,
success: <CheckCircleIcon />,
Expand All @@ -57,15 +56,16 @@ export const HelperTextItem: React.FunctionComponent<HelperTextItemProps> = ({
}: HelperTextItemProps) => {
const Component = component as any;
const isNotDefaultVariant = variant !== 'default';
const defaultIcon = isNotDefaultVariant && defaultVariantIcons[variant];
return (
<Component
className={css(styles.helperTextItem, isNotDefaultVariant && styles.modifiers[variant], className)}
id={id}
{...props}
>
{(isNotDefaultVariant || icon) && (
{(defaultIcon || icon) && (
<span className={css(styles.helperTextItemIcon)} aria-hidden>
{icon || defaultVariantIcons[variant]}
{icon || defaultIcon}
</span>
)}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ import ExclamationIcon from '@patternfly/react-icons/dist/esm/icons/exclamation-

### Basic

```ts file="HelperTextStatic.tsx"
```ts file="HelperTextBasic.tsx"

```

### With custom icons

```ts file="HelperTextStaticWithCustomIcon.tsx"
```ts file="HelperTextWithCustomIcon.tsx"

```

### Multiple items

You can pass multiple `<HelperTextItem>` components inside a single `<Helpertext>` container.

```ts file="HelperTextMultipleStatic.tsx"
```ts file="HelperTextMultipleItems.tsx"

```

0 comments on commit a658ca3

Please sign in to comment.