Skip to content

Commit

Permalink
Merge pull request #59 from DanielBrito/issue43
Browse files Browse the repository at this point in the history
feat: add error page
  • Loading branch information
DanielBrito authored Aug 20, 2024
2 parents 0d52d36 + bd4cb52 commit d1ab0c2
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 5 deletions.
Binary file added src/assets/general/not_found.webp
Binary file not shown.
28 changes: 28 additions & 0 deletions src/pages/Error/Error.css
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;
}
9 changes: 4 additions & 5 deletions src/pages/Error/Error.jsx
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>
);
}

0 comments on commit d1ab0c2

Please sign in to comment.