UNPKG

@uiw/react-native

Version:
15 lines (14 loc) 520 B
import React, { useContext } from 'react'; import { ThemeProvider as ShopifyThemeProvider, ThemeContext } from '@shopify/restyle'; import theme from '../theme'; const { lightTheme } = theme; const ThemeProvider = ({ theme = lightTheme, children }) => { return <ShopifyThemeProvider theme={theme}>{children}</ShopifyThemeProvider>; }; function useTheme() { const theme = useContext(ThemeContext); return theme; } ThemeProvider.displayName = 'ThemeProvider'; export { useTheme }; export default ThemeProvider;