From 3452e47c94a55a525620c244f57edb9482989d1c Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Sat, 14 Sep 2024 20:32:16 +0100 Subject: [PATCH] feature(mobile): Add a page for testing connection to server --- apps/mobile/app/_layout.tsx | 9 + apps/mobile/app/signin.tsx | 37 ++- apps/mobile/app/test-connection.tsx | 113 +++++++ apps/mobile/package.json | 1 + pnpm-lock.yaml | 455 ++++++++++++++++------------ 5 files changed, 414 insertions(+), 201 deletions(-) create mode 100644 apps/mobile/app/test-connection.tsx diff --git a/apps/mobile/app/_layout.tsx b/apps/mobile/app/_layout.tsx index 41186842..677a0638 100644 --- a/apps/mobile/app/_layout.tsx +++ b/apps/mobile/app/_layout.tsx @@ -48,10 +48,19 @@ export default function RootLayout() { contentClassName="bg-gray-100 dark:bg-background" screenOptions={{ headerShown: false, + headerTransparent: true, }} > + diff --git a/apps/mobile/app/signin.tsx b/apps/mobile/app/signin.tsx index cfe32ea1..6190c258 100644 --- a/apps/mobile/app/signin.tsx +++ b/apps/mobile/app/signin.tsx @@ -3,19 +3,23 @@ import { Keyboard, KeyboardAvoidingView, Platform, + Pressable, Text, TouchableWithoutFeedback, View, } from "react-native"; -import { Redirect } from "expo-router"; +import { Redirect, useRouter } from "expo-router"; import Logo from "@/components/Logo"; import { TailwindResolver } from "@/components/TailwindResolver"; -import { Button } from "@/components/ui/Button"; +import { Button, buttonVariants } from "@/components/ui/Button"; import { Input } from "@/components/ui/Input"; import useAppSettings from "@/lib/settings"; import { api } from "@/lib/trpc"; +import { cn } from "@/lib/utils"; +import { Bug } from "lucide-react-native"; export default function Signin() { + const router = useRouter(); const { settings, setSettings } = useAppSettings(); const [serverAddress, setServerAddress] = useState(settings.address); @@ -109,12 +113,29 @@ export default function Signin() { onChangeText={(e) => setFormData((s) => ({ ...s, password: e }))} /> -