-
Notifications
You must be signed in to change notification settings - Fork 6
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 #141 from Program-AR/pb-error
PBError mas lindo
- Loading branch information
Showing
11 changed files
with
57 additions
and
38 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,8 @@ | ||
{ | ||
"home": "Go to home page", | ||
"errorOcurred": "An error occurred (✖╭╮✖)", | ||
"pageNotFound": { | ||
"title": "Page not found", | ||
"text": "The page you are trying to access does not exist." | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,8 @@ | ||
{ | ||
"home": "Ir al inicio", | ||
"errorOcurred": "Ocurrió un error (✖╭╮✖)", | ||
"pageNotFound": { | ||
"title": "Página no encontrada", | ||
"text": "La página a la que intentás acceder no existe." | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,8 @@ | ||
{ | ||
"home": "Vá para iniciar", | ||
"errorOcurred": "Um erro ocorreu (✖╭╮✖)", | ||
"pageNotFound": { | ||
"title": "Página não encontrada", | ||
"text": "A página que você está tentando acessar não existe." | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
File renamed without changes.
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 @@ | ||
import { Typography, Button, Stack } from "@mui/material" | ||
import { Link, useRouteError } from "react-router-dom"; | ||
import { useTranslation } from "react-i18next"; | ||
import styles from "./PBError.module.css" | ||
import { Header } from "../header/Header"; | ||
|
||
type PbErrorProps = { | ||
title?: string, | ||
error?: string, | ||
} | ||
|
||
export const PBError = (props: PbErrorProps) =>{ | ||
const {t} = useTranslation("pbError") | ||
|
||
const error = useRouteError() as any | ||
|
||
return <> | ||
<Header/> | ||
<Stack direction='column' alignItems='center'> | ||
<Typography className={styles.title} variant="h4">{props.title ? props.title : t("errorOcurred")}</Typography> | ||
<img alt="capy" className={styles.image} src='imagenes/capy_error.png' /> | ||
<Typography className={styles.text} variant="h6">{props.error ? props.error : error.message}</Typography> | ||
<Link to="/"> | ||
<Button variant="contained" color="success" >{t("home")}</Button> | ||
</Link> | ||
</Stack> | ||
</> | ||
} |
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,20 +1,8 @@ | ||
import { Typography, Button, Stack } from "@mui/material" | ||
import { Link } from "react-router-dom"; | ||
import { useTranslation } from "react-i18next"; | ||
import { Header } from "../header/Header" | ||
import styles from "./pageNotFound.module.css" | ||
import { PBError } from "./PBError"; | ||
|
||
export const PageNotFound = () =>{ | ||
const {t} = useTranslation("pageNotFound") | ||
return <> | ||
<Header/> | ||
<Stack direction='column' alignItems='center'> | ||
<Typography className={styles.title} variant="h4">{t("title")}</Typography> | ||
<img alt="capy" className={styles.image} src='imagenes/capy_error.png' /> | ||
<Typography className={styles.text} variant="h6">{t("text")}</Typography> | ||
<Link to=""> | ||
<Button variant="contained" color="success" >{t("home")}</Button> | ||
</Link> | ||
</Stack> | ||
</> | ||
const {t} = useTranslation("pbError") | ||
|
||
return <PBError title={t("pageNotFound.title")!} error={t("pageNotFound.text")!}/> | ||
} |