diff --git a/common/ThemeTypes.tsx b/common/ThemeTypes.tsx index 0572e96..6adf757 100644 --- a/common/ThemeTypes.tsx +++ b/common/ThemeTypes.tsx @@ -94,6 +94,7 @@ export const ThemeTextInput = ({ style, value, disabled, onValueChange, secureTe paddingRight: 14, paddingLeft: 8, paddingVertical: 1, + marginVertical: 5, borderColor: disabled ? colors.textDisabled : colors.text, borderWidth: 1, }, diff --git a/common/Toast.tsx b/common/Toast.tsx index 8ea67db..b899e9e 100644 --- a/common/Toast.tsx +++ b/common/Toast.tsx @@ -4,7 +4,6 @@ import { useSafeAreaInsets } from "react-native-safe-area-context"; import { ToastType, useToast } from "./ToastProvider"; const fadeDuration = 300; -const tabBarHeight = 60; export const Toast: React.FC = () => { const insets = useSafeAreaInsets(); @@ -60,7 +59,7 @@ export const Toast: React.FC = () => { @@ -86,4 +85,4 @@ const styles = StyleSheet.create({ textAlign: "center", color: '#fff', }, -}); \ No newline at end of file +}); diff --git a/screens/Login.tsx b/screens/Login.tsx index 09e6ea3..ef7fb86 100644 --- a/screens/Login.tsx +++ b/screens/Login.tsx @@ -1,12 +1,11 @@ -import React, { useState, useEffect, useContext, useRef } from 'react'; -import { View, Text, ScrollView, Button, StyleSheet, TouchableOpacity, ActivityIndicator, Alert, Animated, Image } from 'react-native'; +import React, { useState, useEffect, useContext } from 'react'; +import { View, ScrollView, Button, StyleSheet, Image, ActivityIndicator, Alert } from 'react-native'; import { SettingsContext } from '../SettingsProvider'; import { useColors } from '../common/colors'; import ErrorBoundary from 'react-native-error-boundary'; -import { ThemeSwitch, ThemeText, ThemeTextInput } from '../common/ThemeTypes'; +import { ThemeText, ThemeTextInput } from '../common/ThemeTypes'; import Credits from '../common/Credits'; -import FontAwesome5 from '@expo/vector-icons/FontAwesome5'; -import { ServerSettings } from './Settings'; +import { AdvancedSettings } from './Settings'; const Login = () => { const colors = useColors(); @@ -15,23 +14,14 @@ const Login = () => { const [url, setUrl] = useState(''); const [username, setUsername] = useState(''); const [password, setPassword] = useState(''); - const [isSystemTheme, setIsSystemTheme] = useState(settings.systemTheme); - const [isDarkMode, setIsDarkMode] = useState(settings.darkTheme); const [requireAuth, setRequireAuth] = useState(settings.requireAuth); const [isSaving, setIsSaving] = useState(false); - const [showAdvanced, setShowAdvanced] = useState(false); - const [rotateAnim] = useState(new Animated.Value(0)); // Animation state for the arrow - const [advancedHeightAnim] = useState(new Animated.Value(0)); // Animation state for the advanced settings height - - const advancedSectionRef = useRef(null); useEffect(() => { if (settings) { setUrl(settings.url || ''); setUsername(settings.username || ''); setPassword(settings.password || ''); - setIsSystemTheme(settings.systemTheme); - setIsDarkMode(settings.darkTheme); setRequireAuth(settings.requireAuth); } }, [settings]); @@ -42,11 +32,10 @@ const Login = () => { try { setIsSaving(true); await updateSettings({ + ...settings, url, username, password, - systemTheme: isSystemTheme, - darkTheme: isDarkMode, requireAuth, }); } catch (error) { @@ -61,30 +50,6 @@ const Login = () => { setter(value); }; - const toggleAdvancedSettings = () => { - setShowAdvanced(!showAdvanced); - - // Rotate the arrow - Animated.timing(rotateAnim, { - toValue: showAdvanced ? 0 : 1, - duration: 200, - useNativeDriver: true, - }).start(); - - // Animate the height of the advanced settings - const targetHeight = showAdvanced ? 0 : 150; // You can adjust this height - Animated.timing(advancedHeightAnim, { - toValue: targetHeight, - duration: 300, - useNativeDriver: false, - }).start(); - }; - - const arrowRotation = rotateAnim.interpolate({ - inputRange: [0, 1], - outputRange: ['0deg', '90deg'], - }); - const styles = StyleSheet.create({ container: { flex: 1, @@ -98,32 +63,11 @@ const Login = () => { section: { marginBottom: 40, }, - switchContainer: { - marginTop: 15, - flexDirection: 'row', - alignItems: 'center', - justifyContent: 'space-between', - }, activityindicator: { position: 'absolute', width: '100%', height: '100%', }, - arrowContainer: { - display: 'flex', - justifyContent: 'center', - marginTop: 20, - flexDirection: 'row', - alignItems: 'center', - }, - advancedButtonText: { - marginLeft: 8, - fontSize: 16, - color: colors.text, - }, - advancedSection: { - overflow: 'hidden', - }, logo: { width: 100, height: 100, @@ -141,7 +85,37 @@ const Login = () => { - + + + Benutzername + + Passwort + + + + +