diff --git a/app/login.tsx b/app/login.tsx index 54aa03a8..614ad793 100644 --- a/app/login.tsx +++ b/app/login.tsx @@ -2,8 +2,13 @@ import { Button } from "@/components/Button"; import { Input } from "@/components/common/Input"; import { Text } from "@/components/common/Text"; import { PreviousServersList } from "@/components/PreviousServersList"; +import { Colors } from "@/constants/Colors"; import { apiAtom, useJellyfin } from "@/providers/JellyfinProvider"; -import { Ionicons } from "@expo/vector-icons"; +import { + Ionicons, + MaterialCommunityIcons, + MaterialIcons, +} from "@expo/vector-icons"; import { PublicSystemInfo } from "@jellyfin/sdk/lib/generated-client"; import { getSystemApi } from "@jellyfin/sdk/lib/utils/api"; import { Image } from "expo-image"; @@ -39,7 +44,6 @@ const Login: React.FC = () => { const [serverURL, setServerURL] = useState(_apiUrl); const [serverName, setServerName] = useState(""); - const [error, setError] = useState(""); const [credentials, setCredentials] = useState<{ username: string; password: string; @@ -77,8 +81,10 @@ const Login: React.FC = () => { onPress={() => { removeServer(); }} + className="flex flex-row items-center" > - + + Change server ) : null, }); @@ -95,9 +101,9 @@ const Login: React.FC = () => { } } catch (error) { if (error instanceof Error) { - setError(error.message); + Alert.alert("Connection failed", error.message); } else { - setError("An unexpected error occurred"); + Alert.alert("Connection failed", "An unexpected error occurred"); } } finally { setLoading(false); @@ -136,6 +142,8 @@ const Login: React.FC = () => { return url; } + return undefined; + } catch { return undefined; } finally { setLoadingServerCheck(false); @@ -230,7 +238,6 @@ const Login: React.FC = () => { /> setCredentials({ ...credentials, password: text }) @@ -244,28 +251,34 @@ const Login: React.FC = () => { clearButtonMode="while-editing" maxLength={500} /> + + + + + + - - {error} - - - - + ) : ( <> - + { Enter the URL to your Jellyfin server { textContentType="URL" maxLength={500} /> - - Make sure to include http or https - - { - handleConnect(s.address); - }} - /> - - + + { + handleConnect(s.address); + }} + /> diff --git a/components/Button.tsx b/components/Button.tsx index fb685f4c..1bb8aa92 100644 --- a/components/Button.tsx +++ b/components/Button.tsx @@ -37,7 +37,7 @@ export const Button: React.FC> = ({ case "red": return "bg-red-600"; case "black": - return "bg-neutral-900 border border-neutral-800"; + return "bg-neutral-900"; case "transparent": return "bg-transparent"; } diff --git a/components/common/Input.tsx b/components/common/Input.tsx index ba4ab45b..d82a3225 100644 --- a/components/common/Input.tsx +++ b/components/common/Input.tsx @@ -7,7 +7,7 @@ export function Input(props: TextInputProps) { return (