File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " @observation.org/react-native-components" ,
3- "version" : " 1.72 .0" ,
3+ "version" : " 1.73 .0" ,
44 "main" : " src/index.ts" ,
55 "repository" : " git@github.com:observation/react-native-components.git" ,
66 "author" : " Observation.org" ,
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ import BrandIcons from './lib/BrandIcons'
3434import Icons , { IconName } from './lib/Icons'
3535import { setLogConfiguration } from './lib/Log'
3636import { openUrl } from './lib/Url'
37+ import { ThemeProvider } from './theme/ThemeProvider'
3738
3839export {
3940 Accordion ,
@@ -66,6 +67,7 @@ export {
6667 ProgressBar ,
6768 ProgressBarList ,
6869 TextLink ,
70+ ThemeProvider ,
6971 Tooltip ,
7072 WebLink ,
7173 openUrl ,
Original file line number Diff line number Diff line change 1+ import { createContext , useContext } from 'react'
2+
3+ import { Theme } from '../@types/theme'
4+ import defaultTheme from '../styles/theme'
5+
6+ const ThemeContext = createContext < Theme > ( defaultTheme )
7+
8+ export const ThemeProvider = ( { theme, children } : { theme : Theme ; children : React . ReactNode } ) => {
9+ return < ThemeContext . Provider value = { theme } > { children } </ ThemeContext . Provider >
10+ }
11+
12+ export const useTheme = ( ) => useContext ( ThemeContext )
You can’t perform that action at this time.
0 commit comments