UNPKG

wix-style-react

Version:
27 lines (24 loc) 1.03 kB
import React from 'react'; import PropTypes from 'prop-types'; import { WixStyleReactEnvironmentContext } from './context'; /** A wrapper component for an app to hold cross library global configuration such as locale, rtl and others */ var WixStyleReactEnvironmentProvider = function WixStyleReactEnvironmentProvider(_ref) { var locale = _ref.locale, children = _ref.children; return /*#__PURE__*/React.createElement(WixStyleReactEnvironmentContext.Provider, { value: { locale: locale } }, children); }; WixStyleReactEnvironmentProvider.displayName = 'WixStyleReactEnvironmentProvider'; WixStyleReactEnvironmentProvider.propTypes = { /** Define the user locale to be used and effect some translation and localization (like DatePicker) - this should be compliant to Intl language codes*/ locale: PropTypes.string, /** any content to be displayed */ children: PropTypes.node }; WixStyleReactEnvironmentProvider.defaultProps = { locale: 'en' }; export default WixStyleReactEnvironmentProvider;