From 5d4e25125102eb30bc8851d67d06f20893e22684 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Wed, 19 Jul 2023 10:55:01 +0900 Subject: [PATCH] Allow user to change account when one server does not answer --- front/apps/mobile/app/_layout.tsx | 39 +++++------------ front/apps/mobile/app/connection-error.tsx | 50 ++++++++++++++++++++++ front/packages/models/src/accounts.tsx | 15 ++++--- front/packages/models/src/login.ts | 1 + front/packages/ui/src/navbar/index.tsx | 2 +- 5 files changed, 73 insertions(+), 34 deletions(-) create mode 100644 front/apps/mobile/app/connection-error.tsx diff --git a/front/apps/mobile/app/_layout.tsx b/front/apps/mobile/app/_layout.tsx index e7cfc5c4..76976a7d 100644 --- a/front/apps/mobile/app/_layout.tsx +++ b/front/apps/mobile/app/_layout.tsx @@ -37,10 +37,7 @@ import { useEffect, useState } from "react"; import { useColorScheme } from "react-native"; import { initReactI18next } from "react-i18next"; import { useTheme } from "yoshiki/native"; -import { Button, CircularProgress, H1, P, ts } from "@kyoo/primitives"; -import { useTranslation } from "react-i18next"; -import { View } from "react-native"; -import { useYoshiki } from "yoshiki/native"; +import { CircularProgress } from "@kyoo/primitives"; import { useRouter } from "solito/router"; import "intl-pluralrules"; @@ -60,24 +57,15 @@ i18next.use(initReactI18next).init({ }, }); -export const ConnectionError = ({ error, retry }: { error?: string; retry: () => void }) => { - const { css } = useYoshiki(); - const { t } = useTranslation(); +export const ConnectionError = () => { const router = useRouter(); - return ( - -

{t("errors.connection")}

-

{error ?? t("error.unknown")}

-

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

-