@shopgate/engage
Version:
Shopgate's ENGAGE library.
27 lines (24 loc) • 934 B
JavaScript
import React, { createContext, memo } from 'react';
import PropTypes from 'prop-types';
import ActiveBreakpointProvider from "./ActiveBreakpointProvider";
/** @typedef {import('../index').Theme} Theme */
/** @type {import('react').Context<Theme>} */
import { jsx as _jsx } from "react/jsx-runtime";
export const ThemeContext = /*#__PURE__*/createContext();
/**
* The ThemeProvider component provides the theme context to its children.
* @param {Object} props The component props
* @param {Theme} props.theme The theme object to provide
* @param {React.ReactNode} props.children The children to render within the provider
* @returns {JSX.Element} The ThemeProvider component
*/
const ThemeProvider = ({
children,
theme
}) => /*#__PURE__*/_jsx(ThemeContext.Provider, {
value: theme,
children: /*#__PURE__*/_jsx(ActiveBreakpointProvider, {
children: children
})
});
export default /*#__PURE__*/memo(ThemeProvider);