diff --git a/app/_layout.tsx b/app/_layout.tsx index a7054434..c4d9debb 100644 --- a/app/_layout.tsx +++ b/app/_layout.tsx @@ -336,7 +336,11 @@ function Layout() { /> diff --git a/app/login.tsx b/app/login.tsx index eadd8969..47df24a3 100644 --- a/app/login.tsx +++ b/app/login.tsx @@ -6,7 +6,7 @@ import { Ionicons } 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"; -import { useLocalSearchParams } from "expo-router"; +import { useLocalSearchParams, useNavigation } from "expo-router"; import { useAtom } from "jotai"; import React, { useEffect, useState } from "react"; import { @@ -14,6 +14,7 @@ import { KeyboardAvoidingView, Platform, SafeAreaView, + TouchableOpacity, View, } from "react-native"; @@ -65,6 +66,23 @@ const Login: React.FC = () => { })(); }, [_apiUrl, _username, _password]); + const navigation = useNavigation(); + useEffect(() => { + navigation.setOptions({ + headerTitle: serverName, + headerLeft: () => + api?.basePath ? ( + { + removeServer(); + }} + > + + + ) : null, + }); + }, [serverName, navigation, api?.basePath]); + const [loading, setLoading] = useState(false); const handleLogin = async () => { @@ -176,38 +194,14 @@ const Login: React.FC = () => { behavior={Platform.OS === "ios" ? "padding" : "height"} style={{ flex: 1, height: "100%" }} > - - - - - {serverName || "Streamyfin"} - - - URL - - {api.basePath} - - - - - + + - Log in + + Log in to{" "} + {serverName} + + {serverURL}