diff --git a/packages/module/src/ErrorBoundary/ErrorBoundary.tsx b/packages/module/src/ErrorBoundary/ErrorBoundary.tsx index 9c47cb29..bd0c48f5 100644 --- a/packages/module/src/ErrorBoundary/ErrorBoundary.tsx +++ b/packages/module/src/ErrorBoundary/ErrorBoundary.tsx @@ -4,17 +4,19 @@ import ErrorState from '../ErrorState'; import ErrorStack from '../ErrorStack'; export interface ErrorPageProps { - /** Title to display on the error page */ + /** The title text to display on the error page */ headerTitle: string; - /** Indicates if this is a silent error */ + /** Indicates if the error is silent */ silent?: boolean; - /** Title given to the error */ + /** The title text to display with the error */ errorTitle?: string; - /** A description of the error */ + /** The description text to display with the error */ errorDescription?: React.ReactNode; - /** A default description of the error used if no errorDescription is provided. */ + /** The text for the toggle link that users can select to view error details */ + errorToggleText?: string; + /** The default description text to display with the error if no errorDescription is provided */ defaultErrorDescription?: React.ReactNode; - /** Children components */ + /** The component that the error boundary component is wrapped around, which should be returned if there is no error */ children?: React.ReactNode; } @@ -28,7 +30,7 @@ export interface ErrorPageState { } // As of time of writing, React only supports error boundaries in class components -class ErrorBoundary extends React.Component, ErrorPageState> { +class ErrorBoundary extends React.Component { constructor(props: Readonly) { super(props); this.state = { @@ -72,7 +74,7 @@ class ErrorBoundary extends React.Component {this.props.errorDescription} {this.state.error && ( - + )} diff --git a/packages/module/src/InvalidObject/InvalidObject.tsx b/packages/module/src/InvalidObject/InvalidObject.tsx index 3efde874..669f156a 100644 --- a/packages/module/src/InvalidObject/InvalidObject.tsx +++ b/packages/module/src/InvalidObject/InvalidObject.tsx @@ -4,20 +4,26 @@ import NotFoundIcon from '../NotFoundIcon/NotFoundIcon'; import React from 'react'; export interface InvalidObjectProps extends React.DetailedHTMLProps, HTMLElement> { - /** Custom landing page button URL */ + /** The URL that the landing page link points to */ toLandingPageUrl?: string; - /** Custom return to landing page text */ + /** The text label for the link that points back to the landing page */ toLandingPageText?: React.ReactNode; + /** The title for the invalid object message */ + invalidObjectTitleText?: string; + /** The body text for the invalid object message */ + invalidObjectBodyText?: string; } const InvalidObject: React.FunctionComponent = ({ toLandingPageUrl = window.location.origin, - toLandingPageText = 'Return to homepage' + toLandingPageText = 'Return to homepage', + invalidObjectTitleText = 'We lost that page', + invalidObjectBodyText = "Let's find you a new one. Try a new search or return home." }: InvalidObjectProps) => ( - } headingLevel='h1' /> - Let's find you a new one. Try a new search or return home. + } headingLevel='h1' /> + {invalidObjectBodyText} {' '} - for known outages. + {unavailableBodyPostStatusLinkText} );