1 | import _extends from "@babel/runtime/helpers/esm/extends";
|
2 | import * as React from 'react';
|
3 | import PropTypes from 'prop-types';
|
4 | import withWidth, { isWidthDown } from '../withWidth';
|
5 | let warnedOnce = false;
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | const withMobileDialog = (options = {}) => Component => {
|
13 | if (process.env.NODE_ENV !== 'production') {
|
14 | if (!warnedOnce) {
|
15 | console.warn(['Material-UI: The `withMobileDialog` function is deprecated.', 'Head to https://material-ui.com/r/migration-v4/#dialog for a migration path.'].join('\n'));
|
16 | warnedOnce = true;
|
17 | }
|
18 | }
|
19 |
|
20 | const {
|
21 | breakpoint = 'sm'
|
22 | } = options;
|
23 |
|
24 | function WithMobileDialog(props) {
|
25 | return React.createElement(Component, _extends({
|
26 | fullScreen: isWidthDown(breakpoint, props.width)
|
27 | }, props));
|
28 | }
|
29 |
|
30 | process.env.NODE_ENV !== "production" ? WithMobileDialog.propTypes = {
|
31 | width: PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl']).isRequired
|
32 | } : void 0;
|
33 | return withWidth()(WithMobileDialog);
|
34 | };
|
35 |
|
36 | export default withMobileDialog; |
\ | No newline at end of file |