From 1a4e88a64e079201ef5b5ab1a5d76aa9ce8a2c80 Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Sun, 31 Aug 2025 16:32:20 +0100 Subject: feat(mobile): Add a default server address during signin --- apps/mobile/app/signin.tsx | 92 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 78 insertions(+), 14 deletions(-) diff --git a/apps/mobile/app/signin.tsx b/apps/mobile/app/signin.tsx index 215b6a67..404be438 100644 --- a/apps/mobile/app/signin.tsx +++ b/apps/mobile/app/signin.tsx @@ -15,7 +15,7 @@ import { Input } from "@/components/ui/Input"; import { Text } from "@/components/ui/Text"; import useAppSettings from "@/lib/settings"; import { api } from "@/lib/trpc"; -import { Bug } from "lucide-react-native"; +import { Bug, Check, Edit3, X } from "lucide-react-native"; enum LoginType { Password, @@ -28,6 +28,8 @@ export default function Signin() { const [error, setError] = useState(); const [loginType, setLoginType] = useState(LoginType.Password); + const [isEditingServerAddress, setIsEditingServerAddress] = useState(false); + const [tempServerAddress, setTempServerAddress] = useState(""); const toggleLoginType = () => { setLoginType((prev) => { if (prev === LoginType.Password) { @@ -72,7 +74,7 @@ export default function Signin() { password: string; apiKey: string; }>({ - serverAddress: "", + serverAddress: "https://cloud.karakeep.app", email: "", password: "", apiKey: "", @@ -131,18 +133,80 @@ export default function Signin() { )} Server Address - { - setFormState((s) => ({ ...s, serverAddress: e })); - setSettings({ ...settings, address: e.replace(/\/$/, "") }); - }} - /> + {!isEditingServerAddress ? ( + + + {formState.serverAddress} + + + + ) : ( + + + + + + )} {loginType === LoginType.Password && ( <> -- cgit v1.2.3-70-g09d2