17 lines
416 B
TypeScript
17 lines
416 B
TypeScript
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;
|
|
});*/ |