Skip to content

Commit

Permalink
Merge pull request #2565 from christianvogt/close-error
Browse files Browse the repository at this point in the history
add close button to error boundary
  • Loading branch information
openshift-merge-bot[bot] authored Mar 13, 2024
2 parents e63874e + 3dee280 commit 7b8a60b
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions frontend/src/components/error/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { Title } from '@patternfly/react-core';
import { Button, Split, SplitItem, Title } from '@patternfly/react-core';
import { TimesIcon } from '@patternfly/react-icons';
import ErrorDetails from './ErrorDetails';

type ErrorBoundaryProps = {
Expand Down Expand Up @@ -40,9 +41,24 @@ class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundarySta
const { error, errorInfo } = this.state;
return (
<div className="pf-v5-u-p-lg">
<Title headingLevel="h1" className="pf-v5-u-mb-lg">
An error occurred.
</Title>
<Split>
<SplitItem isFilled>
<Title headingLevel="h1" className="pf-v5-u-mb-lg">
An error occurred.
</Title>
</SplitItem>
<SplitItem>
<Button
variant="plain"
aria-label="Close"
onClick={() => {
this.setState({ hasError: false });
}}
>
<TimesIcon />
</Button>
</SplitItem>
</Split>
<ErrorDetails
title={error.name}
errorMessage={error.message}
Expand Down

0 comments on commit 7b8a60b

Please sign in to comment.