23 lines
935 B
JavaScript
23 lines
935 B
JavaScript
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
|
|
import React from 'react';
|
|
import getDisplayName from './util/getDisplayName';
|
|
import useIsMobile from './useIsMobile';
|
|
|
|
var withIsMobile = function withIsMobile(Component) {
|
|
var Connect = function Connect(props) {
|
|
var _useIsMobile = useIsMobile(),
|
|
isMobile = _useIsMobile.isMobile,
|
|
isCalculated = _useIsMobile.isCalculated;
|
|
|
|
return /*#__PURE__*/React.createElement(Component, _extends({}, props, {
|
|
isMobile: isMobile,
|
|
isCalculated: isCalculated
|
|
}));
|
|
};
|
|
|
|
Connect.displayName = getDisplayName('withIsMobile', Component);
|
|
return Connect;
|
|
};
|
|
|
|
export default withIsMobile; |