theme
This commit is contained in:
17
components/Theme.tsx
Normal file
17
components/Theme.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import {Appearance,ColorSchemeName } from "react-native";
|
||||
import {lightTheme,darkTheme} from './themeColors';
|
||||
|
||||
|
||||
declare global {
|
||||
var theme: typeof lightTheme;
|
||||
}
|
||||
|
||||
global.theme = Appearance.getColorScheme() === "light" ? lightTheme : darkTheme;
|
||||
|
||||
|
||||
/*Appearance.addChangeListener(({ colorScheme }) => {
|
||||
if(colorScheme==="light"){
|
||||
global.theme = lightTheme;
|
||||
}
|
||||
else global.theme = darkTheme;
|
||||
});*/
|
||||
Reference in New Issue
Block a user