Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
innerRef: forwardRef,
directionProp: direction,
elevationProp: elevation,
fillProp: fill,
overflowProp: overflow,
wrapProp: wrap,
responsive: responsive,
theme: theme
}, rest),
contents
);
if (stateTheme) {
if (stateTheme.dark !== propsTheme.dark && stateTheme.icon) {
content = _react2.default.createElement(
_grommetIcons.ThemeContext.Provider,
{ value: stateTheme.icon },
content
);
}
content = _react2.default.createElement(
_contexts.ThemeContext.Provider,
{ value: stateTheme },
content
);
}
return content;
};
var IconThemeComponent = function IconThemeComponent(props) {
return _react2.default.createElement(
_grommetIcons.ThemeContext.Consumer,
null,
function (iconTheme) {
return _react2.default.createElement(WrappedComponent, _extends({}, props, { iconTheme: iconTheme }));
}
);
};
}
if (onEsc) {
content = _react2.default.createElement(
_Keyboard.Keyboard,
{ target: 'document', onEsc: onEsc },
content
);
}
if (modal) {
content = _react2.default.createElement(
_FocusedContainer2.default,
{ hidden: position === 'hidden', restrictScroll: true },
_react2.default.createElement(
_grommetIcons.ThemeContext.Provider,
{ value: theme.icon },
content
)
);
}
return content;
};
Grommet.prototype.render = function render() {
var _props = this.props,
children = _props.children,
rest = _objectWithoutProperties(_props, ['children']);
delete rest.theme;
var _state = this.state,
responsive = _state.responsive,
theme = _state.theme;
return _react2.default.createElement(
_contexts.ThemeContext.Provider,
{ value: theme },
_react2.default.createElement(
_grommetIcons.ThemeContext.Provider,
{ value: theme.icon },
_react2.default.createElement(
_contexts.ResponsiveContext.Provider,
{ value: responsive },
_react2.default.createElement(
_StyledGrommet2.default,
_extends({}, rest, { theme: theme }),
children
)
)
)
);
};