Completely updated React, fixed #11, (hopefully)
This commit is contained in:
17
goTorrentWebUI/node_modules/material-ui/es/Dialog/withMobileDialog.js
generated
vendored
17
goTorrentWebUI/node_modules/material-ui/es/Dialog/withMobileDialog.js
generated
vendored
@@ -1,26 +1,23 @@
|
||||
var _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; };
|
||||
|
||||
import _extends from 'babel-runtime/helpers/extends';
|
||||
import React from 'react';
|
||||
|
||||
import wrapDisplayName from 'recompose/wrapDisplayName';
|
||||
import PropTypes from 'prop-types';
|
||||
import withWidth, { isWidthDown } from '../utils/withWidth';
|
||||
|
||||
|
||||
/**
|
||||
* Dialog will responsively be full screen *at or below* the given breakpoint
|
||||
* (defaults to 'sm' for mobile devices).
|
||||
* Notice that this Higher-order Component is incompatible with server side rendering.
|
||||
*/
|
||||
const withMobileDialog = (options = { breakpoint: 'sm' }) => Component => {
|
||||
const { breakpoint } = options;
|
||||
const withMobileDialog = (options = {}) => Component => {
|
||||
const { breakpoint = 'sm' } = options;
|
||||
|
||||
function WithMobileDialog(props) {
|
||||
return React.createElement(Component, _extends({ fullScreen: isWidthDown(breakpoint, props.width) }, props));
|
||||
}
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
WithMobileDialog.displayName = wrapDisplayName(Component, 'withMobileDialog');
|
||||
}
|
||||
WithMobileDialog.propTypes = process.env.NODE_ENV !== "production" ? {
|
||||
width: PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl']).isRequired
|
||||
} : {};
|
||||
|
||||
return withWidth()(WithMobileDialog);
|
||||
};
|
||||
|
Reference in New Issue
Block a user