File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
packages/react-core/src/components/HelperText Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,6 @@ export interface HelperTextItemProps extends React.HTMLProps<HTMLDivElement | HT
38
38
}
39
39
40
40
const defaultVariantIcons = {
41
- default : < > </ > ,
42
41
indeterminate : < MinusIcon /> ,
43
42
warning : < ExclamationTriangleIcon /> ,
44
43
success : < CheckCircleIcon /> ,
@@ -57,15 +56,16 @@ export const HelperTextItem: React.FunctionComponent<HelperTextItemProps> = ({
57
56
} : HelperTextItemProps ) => {
58
57
const Component = component as any ;
59
58
const isNotDefaultVariant = variant !== 'default' ;
59
+ const defaultIcon = isNotDefaultVariant && defaultVariantIcons [ variant ] ;
60
60
return (
61
61
< Component
62
62
className = { css ( styles . helperTextItem , isNotDefaultVariant && styles . modifiers [ variant ] , className ) }
63
63
id = { id }
64
64
{ ...props }
65
65
>
66
- { ( isNotDefaultVariant || icon ) && (
66
+ { ( defaultIcon || icon ) && (
67
67
< span className = { css ( styles . helperTextItemIcon ) } aria-hidden >
68
- { icon || defaultVariantIcons [ variant ] }
68
+ { icon || defaultIcon }
69
69
</ span >
70
70
) }
71
71
Original file line number Diff line number Diff line change @@ -15,20 +15,20 @@ import ExclamationIcon from '@patternfly/react-icons/dist/esm/icons/exclamation-
15
15
16
16
### Basic
17
17
18
- ``` ts file="HelperTextStatic .tsx"
18
+ ``` ts file="HelperTextBasic .tsx"
19
19
20
20
```
21
21
22
22
### With custom icons
23
23
24
- ``` ts file="HelperTextStaticWithCustomIcon .tsx"
24
+ ``` ts file="HelperTextWithCustomIcon .tsx"
25
25
26
26
```
27
27
28
28
### Multiple items
29
29
30
30
You can pass multiple ` <HelperTextItem> ` components inside a single ` <Helpertext> ` container.
31
31
32
- ``` ts file="HelperTextMultipleStatic .tsx"
32
+ ``` ts file="HelperTextMultipleItems .tsx"
33
33
34
34
```
You can’t perform that action at this time.
0 commit comments