Skip to content

Commit

Permalink
feat: update global error screen (#313)
Browse files Browse the repository at this point in the history
![image](https://github.com/user-attachments/assets/6771413f-ef12-499c-a7a9-40308378f0f1)

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Caio Borghi <[email protected]>
  • Loading branch information
3 people authored Sep 24, 2024
1 parent 7bd387c commit 27f39df
Show file tree
Hide file tree
Showing 4 changed files with 2,357 additions and 2,362 deletions.
33 changes: 27 additions & 6 deletions apps/web/app/global-error.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
'use client'

import Image from 'next/image'
import errorImage from 'public/images/errorImage.png'

export default function GlobalError({
reset,
}: {
Expand All @@ -8,12 +11,30 @@ export default function GlobalError({
}) {
return (
<html>
<body>
<h2>Algo deu errado!</h2>
<button onClick={() => reset()}>Tente novamente</button>
<a className="pl-2" href="/">
Volte para a página inicial
</a>
<body className="flex min-h-screen items-center justify-center bg-amber-50 p-4">
<div className="max-w-2xl rounded-lg bg-white p-8 text-center shadow-xl">
<Image
src={errorImage}
alt="Escritório bagunçado com sinais de 'Sem café'"
width={600}
height={600}
className="mb-6 rounded-lg"
/>
<h2 className="text-brown-700 mb-4 text-3xl font-bold">
Oops! Acabou o café!
</h2>
<p className="mb-6 text-lg text-gray-600">
Parece que estamos enfrentando um erro.
</p>
<div className="flex justify-center space-x-4">
<a
href="/"
className="rounded bg-amber-500 px-4 py-2 text-center font-bold text-white transition duration-300 hover:bg-amber-600"
>
Voltar para a Página Inicial
</a>
</div>
</div>
</body>
</html>
)
Expand Down
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web",
"version": "1.0.30",
"version": "1.0.31",
"private": true,
"scripts": {
"dev": "development=true next dev",
Expand Down
Binary file added apps/web/public/images/errorImage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 27f39df

Please sign in to comment.