ICS React Native App
at main 28 lines 720 B view raw
1import { StyleSheet, Appearance, useColorScheme } from "react-native"; 2import { ThemedText, ThemedView, ThemedButton } from "@/components/theme"; 3 4export const ThemeToggle = () => { 5 const colorScheme = useColorScheme(); 6 7 return ( 8 <ThemedView style={styles.settingsContainer}> 9 <ThemedText>colorscheme set to {colorScheme}</ThemedText> 10 <ThemedButton 11 onPress={() => 12 Appearance.setColorScheme(colorScheme === "dark" ? "light" : "dark") 13 } 14 > 15 toggle 16 </ThemedButton> 17 </ThemedView> 18 ); 19}; 20 21const styles = StyleSheet.create({ 22 settingsContainer: { 23 flexDirection: "row", 24 justifyContent: "space-between", 25 alignItems: "center", 26 gap: 8, 27 }, 28});