@uiw/react-native
Version:
UIW for React Native
19 lines • 519 B
JavaScript
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;