Skip to content

Commit 9736486

Browse files
authored
fix(props): of some components to consume ReactNode (#631)
1 parent 07c541c commit 9736486

File tree

13 files changed

+29
-29
lines changed

13 files changed

+29
-29
lines changed

packages/module/src/ErrorBoundary/ErrorBoundary.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ const useStyles = createUseStyles({
1414

1515
export interface ErrorBoundaryProps {
1616
/** The title text to display on the error page */
17-
headerTitle?: string;
17+
headerTitle?: React.ReactNode;
1818
/** Indicates if the error is silent */
1919
silent?: boolean;
2020
/** The title text to display with the error */
21-
errorTitle?: string;
21+
errorTitle?: React.ReactNode;
2222
/** The description text to display with the error */
2323
errorDescription?: React.ReactNode;
2424
/** The default description text to display with the error if no errorDescription is provided */
@@ -130,4 +130,4 @@ class ErrorBoundaryContent extends React.Component<ErrorPageProps, ErrorBoundary
130130
}
131131
};
132132

133-
export default ErrorBoundary;
133+
export default ErrorBoundary;

packages/module/src/ErrorState/ErrorState.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const useStyles = createUseStyles({
2121
/** extends EmptyStateProps */
2222
export interface ErrorStateProps extends Omit<EmptyStateProps, 'children' | 'titleText' | 'status'> {
2323
/** Title of the error. */
24-
titleText?: string;
24+
titleText?: React.ReactNode;
2525
/** A description of the error, if no body text is provided then it will be set to the defaultBodyText. */
2626
bodyText?: React.ReactNode;
2727
/** A default description of the error used if no errorDescription is provided. */

packages/module/src/LogSnippet/LogSnippet.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Alert, AlertVariant, CodeBlock, CodeBlockCode, Flex, FlexItem, FlexProp
44
/** extends FlexProps */
55
export interface LogSnippetProps extends FlexProps {
66
/** Log snippet or code to be displayed */
7-
logSnippet?: string;
7+
logSnippet?: React.ReactNode;
88
/** Message to appear above the log snippet */
99
message: string | React.ReactNode;
1010
/** Log snippet alert variant */
@@ -26,4 +26,4 @@ export const LogSnippet: React.FunctionComponent<LogSnippetProps> = ({ logSnippe
2626
</Flex>
2727
);
2828

29-
export default LogSnippet;
29+
export default LogSnippet;

packages/module/src/Maintenance/Maintenance.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ import { HourglassHalfIcon } from '@patternfly/react-icons';
55
/** extends EmptyStateProps */
66
export interface MaintenanceProps extends Omit<EmptyStateProps, 'children' | 'title'> {
77
/** The title for the maintenance message */
8-
titleText?: string;
8+
titleText?: React.ReactNode;
99
/** Custom body text */
1010
bodyText?: React.ReactNode;
1111
/** A default bodyText used if no bodyText is provided */
1212
defaultBodyText?: React.ReactNode;
1313
/** Start time in a specific time zone */
14-
startTime?: string;
14+
startTime?: React.ReactNode;
1515
/** End time in a specific time zone */
16-
endTime?: string;
16+
endTime?: React.ReactNode;
1717
/** Time zone specification */
18-
timeZone?: string;
18+
timeZone?: React.ReactNode;
1919
/** Information link */
2020
redirectLinkUrl?: string;
2121
/** Information link title */
22-
redirectLinkText?: string;
22+
redirectLinkText?: React.ReactNode;
2323
/** Custom footer content */
2424
customFooter?: React.ReactNode;
2525
/** Custom OUIA ID */

packages/module/src/MissingPage/MissingPage.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ export interface MissingPageProps extends Omit<EmptyStateProps, 'children' | 'ti
99
/** The text label for the link that points back to the home page */
1010
toHomePageText?: React.ReactNode;
1111
/** The title for the invalid object message */
12-
titleText?: string;
12+
titleText?: React.ReactNode;
1313
/** The body text for the invalid object message */
14-
bodyText?: string;
14+
bodyText?: React.ReactNode;
1515
/** Custom OUIA ID */
1616
ouiaId?: string | number;
1717
}
@@ -35,4 +35,4 @@ export const MissingPage: React.FunctionComponent<MissingPageProps> = ({
3535
</EmptyState>
3636
);
3737

38-
export default MissingPage;
38+
export default MissingPage;

packages/module/src/MultiContentCard/MultiContentCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export interface MultiContentCardProps extends Omit<CardProps, 'children' | 'tit
3232
/** Actions to be displayed in the expandable section */
3333
actions?: React.ReactElement;
3434
/** Toggle text for the expandable section */
35-
toggleText?: string;
35+
toggleText?: React.ReactNode;
3636
/** Toggle content for the expandable section */
3737
toggleContent?: React.ReactElement;
3838
/** When set to true, all content cards will be separated with dividers */

packages/module/src/PageHeader/PageHeader.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ export interface PageHeaderLinkProps extends ButtonProps {
2424

2525
export interface PageHeaderProps extends React.PropsWithChildren {
2626
/** Title for page header */
27-
title: string;
27+
title: React.ReactNode;
2828
/** Subtitle for page header */
29-
subtitle: string;
29+
subtitle: React.ReactNode;
3030
/** Optional link below subtitle */
3131
linkProps?: PageHeaderLinkProps;
3232
/** Optional icon for page header (appears to the left of the page header's title with a divider) */

packages/module/src/ServiceCard/ServiceCard.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ export interface ServiceCardProps extends CardProps {
1010
/** Service card title */
1111
title: string;
1212
/** Service card subtitle */
13-
subtitle?: string;
13+
subtitle?: React.ReactNode;
1414
/** Service card description */
15-
description: string;
15+
description: React.ReactNode;
1616
/** Service card icon */
1717
icon: React.ReactNode;
1818
/** Optional Service card helper text*/
19-
helperText?: string;
19+
helperText?: React.ReactNode;
2020
/** Optional footer */
2121
footer?: React.ReactElement | null;
2222
/** Optional custom OUIA ID */
@@ -82,4 +82,4 @@ const ServiceCard: React.FunctionComponent<ServiceCardProps> = ({
8282
)
8383
}
8484

85-
export default ServiceCard;
85+
export default ServiceCard;

packages/module/src/Severity/Severity.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export interface SeverityProps extends React.DetailedHTMLProps<React.HTMLAttribu
4141
/** Determines a variant of displayed severity */
4242
severity: SeverityType;
4343
/** Label displayed next to the severity */
44-
label: string;
44+
label: React.ReactNode;
4545
/** Option to hide the label */
4646
labelHidden?: boolean;
4747
/** Custom className */

packages/module/src/Status/Status.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export interface StatusProps extends React.PropsWithChildren {
2424
/** Status label text */
2525
label?: string;
2626
/** Description to be displayed under the label */
27-
description?: string;
27+
description?: React.ReactNode;
2828
/** If true, only displays icon */
2929
iconOnly?: boolean;
3030
/** Variant of the status component to be displayed */

0 commit comments

Comments
 (0)