-
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 #59 from DanielBrito/issue43
feat: add error page
- Loading branch information
Showing
3 changed files
with
32 additions
and
5 deletions.
There are no files selected for viewing
Binary file not shown.
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,28 @@ | ||
#error-page { | ||
height: 100vh; | ||
|
||
padding: 0 40px; | ||
|
||
overflow: hidden; | ||
|
||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
flex-direction: column; | ||
} | ||
|
||
.not-found-image { | ||
width: 100%; | ||
max-width: 400px; | ||
} | ||
|
||
.message { | ||
position: absolute; | ||
|
||
margin-top: 30px; | ||
padding: 5px; | ||
|
||
font-weight: bold; | ||
color: #fff; | ||
background-color: #d32f2f; | ||
} |
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,16 +1,15 @@ | ||
import { useRouteError } from "react-router-dom"; | ||
import errorImage from "../../assets/general/not_found.webp"; | ||
import "./Error.css"; | ||
|
||
export default function ErrorPage() { | ||
const error = useRouteError(); | ||
console.error(error); | ||
|
||
return ( | ||
<div id="error-page"> | ||
<h1>Opa!</h1> | ||
<p>Uma erro ocorreu ao carregar a página:</p> | ||
<p> | ||
<i>{error.statusText || error.message}</i> | ||
</p> | ||
<img className="not-found-image" src={errorImage} width={"424px"} height={"333px"} /> | ||
<p className="message">Página não encontrada</p> | ||
</div> | ||
); | ||
} |