Last active
May 2, 2021 14:13
-
-
Save Pasi-D/8e5f549511dd5c29d912930677e5fe07 to your computer and use it in GitHub Desktop.
Extended Theme file for react native
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useContext } from "react"; | |
| import { FullTheme, ButtonProps, ThemeContext } from "react-native-elements"; | |
| import { ThemeProps } from "react-native-elements/dist/config/ThemeProvider"; | |
| import { Colors } from "react-native-elements/dist/config/colors"; | |
| import { RecursivePartial } from "utils/core"; | |
| interface IExtendedThemeButtonProps extends Partial<ButtonProps> { | |
| titleAppearances?: { | |
| titleColors?: { | |
| primary: string; | |
| }; | |
| fontFamily?: string; | |
| }; | |
| } | |
| interface IExtendedThemeColorProps extends RecursivePartial<Colors> { | |
| readonly darkBg: string; | |
| } | |
| export interface Theme extends Partial<FullTheme> { | |
| Button?: IExtendedThemeButtonProps; | |
| colors?: IExtendedThemeColorProps; | |
| } | |
| export const useThemeContext = () => useContext<ThemeProps<Theme>>(ThemeContext); | |
| const theme: Theme = { | |
| Button: { | |
| raised: true, | |
| titleAppearances: { | |
| titleColors: { | |
| primary: "#FFF", | |
| }, | |
| fontFamily: "Montserrat", | |
| }, | |
| }, | |
| colors: { | |
| darkBg: "#0F0F0F", | |
| }, | |
| }; | |
| export default theme; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment