From e60e2306b73d83db6e86629e09ed9d814aab3f70 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Sun, 3 Mar 2024 23:55:14 +0100 Subject: [PATCH] Add connection error page on the web --- .../mobile/app/(public)/connection-error.tsx | 29 +--------- front/apps/web/src/pages/_app.tsx | 55 +++++++++++-------- front/packages/models/src/accounts.tsx | 18 +++--- front/packages/models/src/login.ts | 6 +- front/packages/ui/src/errors/connection.tsx | 51 +++++++++++++++++ front/packages/ui/src/errors/index.tsx | 1 + 6 files changed, 99 insertions(+), 61 deletions(-) create mode 100644 front/packages/ui/src/errors/connection.tsx diff --git a/front/apps/mobile/app/(public)/connection-error.tsx b/front/apps/mobile/app/(public)/connection-error.tsx index 2a81145d..a7d7d1c7 100644 --- a/front/apps/mobile/app/(public)/connection-error.tsx +++ b/front/apps/mobile/app/(public)/connection-error.tsx @@ -18,33 +18,6 @@ * along with Kyoo. If not, see . */ -import { ConnectionErrorContext } from "@kyoo/models"; -import { Button, H1, P, ts } from "@kyoo/primitives"; -import { useRouter } from "expo-router"; -import { useContext } from "react"; -import { useTranslation } from "react-i18next"; -import { View } from "react-native"; -import { useYoshiki } from "yoshiki/native"; - -const ConnectionError = () => { - const { css } = useYoshiki(); - const { t } = useTranslation(); - const router = useRouter(); - const { error, retry } = useContext(ConnectionErrorContext); - - return ( - -

{t("errors.connection")}

-

{error?.errors[0] ?? t("error.unknown")}

-

{t("errors.connection-tips")}

-