import Slider from '@react-native-community/slider'; import * as Haptics from 'expo-haptics'; import { Stack, useRouter } from 'expo-router'; import React from 'react'; import { ScrollView, View, Text, Switch, Pressable, Linking } from 'react-native'; import { SafeAreaView } from 'react-native-safe-area-context'; import { Icon } from '@/components/Icon'; import { useStore } from '@/store/store'; import { getThemeColors } from '@/utils/theme'; import { useResponsive } from '@/hooks/useResponsive'; export default function Settings() { const router = useRouter(); const settings = useStore((state) => state.settings); const updateSettings = useStore((state) => state.updateSettings); const handleHaptic = () => { if (settings.hapticFeedback) { Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light); } }; const handleSettingChange = (key: string, value: any) => { handleHaptic(); updateSettings({ [key]: value }); }; const timerOptions = [ { label: 'Aus', value: 0 }, { label: '5 Min', value: 5 }, { label: '10 Min', value: 10 }, { label: '15 Min', value: 15 }, { label: '30 Min', value: 30 }, { label: '60 Min', value: 60 }, ]; const theme = getThemeColors(); const responsive = useResponsive(); return ( {/* Animationsgeschwindigkeit */} Animationsgeschwindigkeit {settings.animationSpeed === 0.5 ? 'Langsam' : settings.animationSpeed === 1 ? 'Normal' : 'Schnell'} handleSettingChange('animationSpeed', value)} minimumTrackTintColor="#6B8DD6" maximumTrackTintColor="#E5E7EB" /> {/* Haptisches Feedback */} Haptisches Feedback Vibration beim Tippen handleSettingChange('hapticFeedback', value)} trackColor={{ false: '#E5E7EB', true: '#6B8DD6' }} /> {/* Helligkeit */} Bildschirm-Helligkeit {Math.round(settings.brightness * 100)}% handleSettingChange('brightness', value)} minimumTrackTintColor="#6B8DD6" maximumTrackTintColor="#E5E7EB" /> {/* Taschenlampen-Helligkeit */} Taschenlampen-Helligkeit Stufe {settings.flashlightBrightness} von 10 handleSettingChange('flashlightBrightness', value)} minimumTrackTintColor="#6B8DD6" maximumTrackTintColor="#E5E7EB" /> {/* Auto-Timer */} Auto-Timer {timerOptions.map((option) => ( handleSettingChange('autoTimer', option.value)} className={`rounded-full px-4 py-2 ${ settings.autoTimer === option.value ? 'bg-blue-500' : 'bg-gray-200' }`} > {option.label} ))} {/* Auto Mood Switch */} Automatischer Mood-Wechsel Wechselt zwischen Moods handleSettingChange('autoMoodSwitch', value)} trackColor={{ false: '#E5E7EB', true: '#6B8DD6' }} /> {settings.autoMoodSwitch && ( <> Intervall: {settings.autoMoodSwitchInterval} Min handleSettingChange('autoMoodSwitchInterval', value)} minimumTrackTintColor="#6B8DD6" maximumTrackTintColor="#E5E7EB" /> )} {/* Credits */} Made by Till Schneider for the{' '} { handleHaptic(); Linking.openURL('https://manacore.ai'); }} > Manacore Free Forever Version 1.0 ); }