diff --git a/src/screens/PlayerSettingsScreen.tsx b/src/screens/PlayerSettingsScreen.tsx index f1530dc1..93fd3425 100644 --- a/src/screens/PlayerSettingsScreen.tsx +++ b/src/screens/PlayerSettingsScreen.tsx @@ -6,14 +6,13 @@ import { ScrollView, SafeAreaView, Platform, - useColorScheme, TouchableOpacity, StatusBar, } from 'react-native'; import { useNavigation } from '@react-navigation/native'; import { useSettings, AppSettings } from '../hooks/useSettings'; -import { colors } from '../styles/colors'; import MaterialIcons from 'react-native-vector-icons/MaterialIcons'; +import { useTheme } from '../contexts/ThemeContext'; const ANDROID_STATUSBAR_HEIGHT = StatusBar.currentHeight || 0; @@ -21,7 +20,6 @@ interface SettingItemProps { title: string; description?: string; icon: string; - isDarkMode: boolean; isSelected: boolean; onPress: () => void; isLast?: boolean; @@ -31,67 +29,69 @@ const SettingItem: React.FC = ({ title, description, icon, - isDarkMode, isSelected, onPress, isLast, -}) => ( - - - - - - - - {title} - - {description && ( +}) => { + const { currentTheme } = useTheme(); + + return ( + + + + + + - {description} + {title} + {description && ( + + {description} + + )} + + {isSelected && ( + )} - {isSelected && ( - - )} - - -); + + ); +}; const PlayerSettingsScreen: React.FC = () => { const { settings, updateSetting } = useSettings(); - const systemColorScheme = useColorScheme(); - const isDarkMode = systemColorScheme === 'dark' || settings.enableDarkMode; + const { currentTheme } = useTheme(); const navigation = useNavigation(); const playerOptions = [ @@ -144,13 +144,13 @@ const PlayerSettingsScreen: React.FC = () => { @@ -162,13 +162,13 @@ const PlayerSettingsScreen: React.FC = () => { Video Player @@ -183,7 +183,7 @@ const PlayerSettingsScreen: React.FC = () => { PLAYER SELECTION @@ -192,9 +192,7 @@ const PlayerSettingsScreen: React.FC = () => { style={[ styles.card, { - backgroundColor: isDarkMode - ? colors.elevation2 - : colors.white, + backgroundColor: currentTheme.colors.elevation2, }, ]} > @@ -204,7 +202,6 @@ const PlayerSettingsScreen: React.FC = () => { title={option.title} description={option.description} icon={option.icon} - isDarkMode={isDarkMode} isSelected={ Platform.OS === 'ios' ? settings.preferredPlayer === option.id