@kiwicom/orbit-components
Version:
Orbit-components is a React component library which provides developers with the easiest possible way of building Kiwi.com’s products.
21 lines (19 loc) • 799 B
JavaScript
import * as React from "react";
import { ThemeProvider as StyledThemeProvider } from "styled-components";
import Dictionary from "../Dictionary";
import QueryContext from "./QueryContext";
import useMediaQueryContext from "./QueryContext/useMediaQueryContext";
var ThemeProvider = function ThemeProvider(_ref) {
var theme = _ref.theme,
dictionary = _ref.dictionary,
children = _ref.children;
var media = useMediaQueryContext();
return /*#__PURE__*/React.createElement(QueryContext.Provider, {
value: media
}, /*#__PURE__*/React.createElement(StyledThemeProvider, {
theme: theme
}, dictionary ? /*#__PURE__*/React.createElement(Dictionary, {
values: dictionary
}, React.Children.only(children)) : React.Children.only(children)));
};
export default ThemeProvider;