useTheme applied globally
This commit is contained in:
parent
1f304d41f2
commit
9de2678922
12 changed files with 31 additions and 39 deletions
|
|
@ -1,7 +1,13 @@
|
|||
import { useColorScheme } from "react-native";
|
||||
import colors from "../constants/colors";
|
||||
|
||||
/**
|
||||
* @deprecated use Theme context instead
|
||||
* @param colorName
|
||||
* @returns
|
||||
*/
|
||||
export function useThemeColor(colorName: keyof typeof colors.light & keyof typeof colors.dark): string {
|
||||
console.warn("useThemeColor is depreciated. Use useTheme().colors instead")
|
||||
const theme = useColorScheme() ?? "light";
|
||||
return colors[theme][colorName];
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue