-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use error boundary lib and setup fallback component
- Loading branch information
Showing
10 changed files
with
147 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
frontend/src/pages/ErrorBoundaryFallback/ErrorBoundaryFallback.styles.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.error-boundary-fallback-container { | ||
width: 100%; | ||
} | ||
|
||
.actionBtn { | ||
display: flex; | ||
align-items: center; | ||
gap: 4px; | ||
} | ||
|
||
.title, | ||
.actions { | ||
display: flex; | ||
align-items: center; | ||
gap: 8px; | ||
} |
55 changes: 55 additions & 0 deletions
55
frontend/src/pages/ErrorBoundaryFallback/ErrorBoundaryFallback.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import './ErrorBoundaryFallback.styles.scss'; | ||
|
||
import { BugOutlined, UndoOutlined } from '@ant-design/icons'; | ||
import { Button, Card, Typography } from 'antd'; | ||
import Slack from 'container/SideNav/Slack'; | ||
|
||
function ErrorBoundaryFallback(): JSX.Element { | ||
const onClickSlackHandler = (): void => { | ||
window.open('https://signoz.io/slack', '_blank'); | ||
}; | ||
|
||
const handleReload = (): void => { | ||
window.location.reload(); | ||
}; | ||
return ( | ||
<Card size="small" className="error-boundary-fallback-container"> | ||
<div className="title"> | ||
<BugOutlined /> | ||
<Typography.Title type="danger" level={4} style={{ margin: 0 }}> | ||
{' '} | ||
Oops !!! Something went wrong | ||
</Typography.Title> | ||
</div> | ||
|
||
<> | ||
<p> | ||
Don't worry, our team is here to help. Please contact support if the | ||
issue persists. | ||
</p> | ||
|
||
<div className="actions"> | ||
<Button | ||
className="actionBtn" | ||
type="default" | ||
onClick={handleReload} | ||
icon={<UndoOutlined />} | ||
> | ||
Reload | ||
</Button> | ||
|
||
<Button | ||
className="actionBtn" | ||
type="default" | ||
onClick={onClickSlackHandler} | ||
icon={<Slack />} | ||
> | ||
Support | ||
</Button> | ||
</div> | ||
</> | ||
</Card> | ||
); | ||
} | ||
|
||
export default ErrorBoundaryFallback; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters