diff --git a/src/Modal/Modal.jsx b/src/Modal/Modal.jsx index f97c8fd..1ca74bc 100644 --- a/src/Modal/Modal.jsx +++ b/src/Modal/Modal.jsx @@ -15,7 +15,12 @@ export default class Modal extends React.Component { onDidClose: PropTypes.func, onDidShow: PropTypes.func, isAutoClosable: PropTypes.boolean, - onClose: PropTypes.func + onClose: PropTypes.func, + customMinWidth: PropTypes.string + }; + + static defaultProps = { + customMinWidth: '960px' }; constructor(props, ...args) { @@ -42,13 +47,13 @@ export default class Modal extends React.Component { componentWillUnmount() { this._enableRootScroll(); } - + componentWillReceiveProps(nextProps) { if (nextProps.isShown !== this.props.isShown) { nextProps.isShown ? this.show() : this.hide(); } } - + show(callback: () => void) { callback && this._onDidShowCallbacks.push(callback); @@ -145,6 +150,8 @@ export default class Modal extends React.Component { } render() { + const customMinWidth = this.props.customMinWidth; + return ( this._teleport = c}> - + {this._renderChildren()} @@ -241,7 +252,6 @@ const styles = StyleSheet.create({ padding: 0, flexDirection: 'column', overflow: 'hidden', - minWidth: '960px', minHeight: '400px', }, shownOverlay: {