-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add 401 error message and cleanup error page (#12548)
* Add unauthorized message when 401 error occurs and clean up error page * Update BaseClearView logo handling to use link instead of direct click on img and enable the link to always go to the parent to re-resolve * Cleanup status check logic on ResourceNotFoundErrorBoundary
- Loading branch information
Showing
5 changed files
with
36 additions
and
38 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
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 |
---|---|---|
@@ -1,35 +1,20 @@ | ||
import React from "react"; | ||
import { FormattedMessage } from "react-intl"; | ||
import styled from "styled-components"; | ||
|
||
import { Button } from "components"; | ||
|
||
import useRouter from "hooks/useRouter"; | ||
import { ErrorOccurredView } from "views/common/ErrorOccurredView"; | ||
|
||
const ResetSection = styled.div` | ||
margin-top: 30px; | ||
display: flex; | ||
justify-content: space-around; | ||
`; | ||
|
||
export const StartOverErrorView: React.FC<{ | ||
interface StartOverErrorViewProps { | ||
message?: string; | ||
onReset?: () => void; | ||
}> = ({ message, onReset }) => { | ||
const { push } = useRouter(); | ||
} | ||
|
||
export const StartOverErrorView: React.FC<StartOverErrorViewProps> = ({ message, onReset }) => { | ||
return ( | ||
<ErrorOccurredView message={message ?? <FormattedMessage id="errorView.notFound" />}> | ||
<ResetSection> | ||
<Button | ||
onClick={() => { | ||
push(".."); | ||
onReset?.(); | ||
}} | ||
> | ||
<FormattedMessage id="errorView.startOver" /> | ||
</Button> | ||
</ResetSection> | ||
</ErrorOccurredView> | ||
<ErrorOccurredView | ||
message={message ?? <FormattedMessage id="errorView.notFound" />} | ||
onBackClick={() => { | ||
onReset?.(); | ||
}} | ||
/> | ||
); | ||
}; |