diff --git a/src/locale/he.json b/src/locale/he.json index 221a83f3..2d619237 100644 --- a/src/locale/he.json +++ b/src/locale/he.json @@ -114,5 +114,11 @@ "lineProfile": { "title": "פרופיל קו", "notFound":"לא הצלחנו למצוא את הקו שחיפשת :(" + }, + "errorPage": { + "title": "אופס, משהו השתבש", + "text": "אנא נסה שוב מאוחר יותר", + "text2": "אם הבעיה נמשכת, אנא פנה אלינו בכתובת:", + "button": "חזרה לדף הבית" } } diff --git a/src/pages/ErrorPage.tsx b/src/pages/ErrorPage.tsx new file mode 100644 index 00000000..8b37566d --- /dev/null +++ b/src/pages/ErrorPage.tsx @@ -0,0 +1,27 @@ +import { useTranslation } from 'react-i18next' +import styled from 'styled-components' + +const Centered = styled.div` + text-align: center; +` + +export const ErrorPage = () => { + const { t } = useTranslation() + return ( + +

{t('errorPage.title')}

+
+

{t('errorPage.text')}

+
+ error +
+

+ {t('errorPage.text2')}
+ + https://github.com/hasadna/open-bus-map-search/issues/new + +

+
+
+ ) +} diff --git a/src/routes/index.tsx b/src/routes/index.tsx index 4f1c8ca9..8803e322 100644 --- a/src/routes/index.tsx +++ b/src/routes/index.tsx @@ -25,6 +25,7 @@ import { LineChartOutlined, } from '@ant-design/icons' import { MainRoute } from './MainRoute' +import { ErrorPage } from 'src/pages/ErrorPage' export const PAGES = [ { @@ -93,12 +94,13 @@ const getRoutesList = () => { return ( }> {routes.map(({ path, element }) => ( - + ))} } + ErrorBoundary={ErrorPage} loader={async ({ params: { gtfsRideGtfsRouteId } }) => { const resp = await fetch( `https://open-bus-stride-api.hasadna.org.il/gtfs_routes/get?id=${gtfsRideGtfsRouteId}`,