'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});
exports.SizeContextProvider = undefined;

var _react = require('react');

var React = _interopRequireWildcard(_react);

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }

var SizeContext = React.createContext(undefined);
var SizeContextProvider = exports.SizeContextProvider = function SizeContextProvider(_ref) {
    var children = _ref.children,
        size = _ref.size;
    return React.createElement(
        SizeContext.Consumer,
        null,
        function (originSize) {
            return React.createElement(
                SizeContext.Provider,
                { value: size || originSize },
                children
            );
        }
    );
};
exports['default'] = SizeContext;