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 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | const withMobileDialog = (options = {}) => Component => {
|
12 | const {
|
13 | breakpoint = 'sm'
|
14 | } = options;
|
15 |
|
16 | function WithMobileDialog(props) {
|
17 | return React.createElement(Component, _extends({
|
18 | fullScreen: isWidthDown(breakpoint, props.width)
|
19 | }, props));
|
20 | }
|
21 |
|
22 | process.env.NODE_ENV !== "production" ? WithMobileDialog.propTypes = {
|
23 | width: PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl']).isRequired
|
24 | } : void 0;
|
25 | return withWidth()(WithMobileDialog);
|
26 | };
|
27 |
|
28 | export default withMobileDialog; |
\ | No newline at end of file |