@uiw/react-native
Version:
UIW for React Native
15 lines (14 loc) • 520 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;