-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #525 from culturecreates/feature/issue-330
Feature/issue 330
- Loading branch information
Showing
9 changed files
with
10,014 additions
and
25,588 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,42 @@ | ||
import { useNavigate, useRouteError } from 'react-router-dom'; | ||
import { ReactComponent as GeneralErrors } from '../../assets/images/general-error.svg'; | ||
import { ReactComponent as Error404 } from '../../assets/images/404-error.svg'; | ||
import './error.css'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { Button } from 'antd'; | ||
|
||
function ErrorAlert(props) { | ||
const { errorType = 'general' } = props; | ||
|
||
const error = useRouteError(); | ||
const navigate = useNavigate(); | ||
const { t } = useTranslation(); | ||
|
||
const image = errorType === 'general' ? <GeneralErrors /> : <Error404 />; | ||
const message = errorType === 'general' ? error.message : t('errorPage.notFoundMessage'); | ||
|
||
console.error(message, new Date().toISOString()); | ||
|
||
return ( | ||
<div className="error-page"> | ||
<div className="content"> | ||
<div className="image-container">{image}</div> | ||
<section> | ||
<h1>{t('errorPage.heading')}</h1> | ||
<p className="error-message">{message}</p> | ||
<p className="error-time">{new Date().toISOString()}</p> | ||
<div className="btn-container"> | ||
<Button | ||
onClick={() => { | ||
navigate(-1); | ||
}}> | ||
{t('errorPage.buttonText')} | ||
</Button> | ||
</div> | ||
</section> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default ErrorAlert; |
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,67 @@ | ||
.error-page { | ||
width: 100vw; | ||
height: 100vh; | ||
overflow: hidden; | ||
background: var(--primary-white); | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
|
||
.error-page .content { | ||
min-width: 500px; | ||
max-width: 700px; | ||
max-height: 750px; | ||
width: 40%; | ||
height: 70%; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-around; | ||
align-items: center; | ||
} | ||
|
||
.error-page .image-container { | ||
height: 40%; | ||
} | ||
|
||
.error-page .image-container > svg { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
.error-page h1 { | ||
color: var(--content-neutral-primary, #222732); | ||
text-align: center; | ||
font-size: 60px; | ||
font-style: normal; | ||
font-weight: 700; | ||
line-height: 120%; | ||
} | ||
|
||
.error-page .error-message, | ||
.error-page .error-time { | ||
color: var(--content-neutral-secondary, #646d7b); | ||
text-align: center; | ||
font-size: 16px; | ||
font-style: normal; | ||
font-weight: 400; | ||
line-height: 24px; | ||
} | ||
|
||
.error-page .btn-container { | ||
display: grid; | ||
place-content: center; | ||
} | ||
|
||
.error-page .btn-container .ant-btn { | ||
border-radius: 4px; | ||
background: var(--content-action-default, #1b3de6); | ||
color: var(--primary-white); | ||
font-weight: 600; | ||
text-transform: capitalize; | ||
border: none; | ||
font-size: 16px; | ||
padding: 8px 16px; | ||
display: grid; | ||
place-content: center; | ||
} |
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