mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +00:00
modal-container extracted from modal itself
This commit is contained in:
parent
83d5349b4f
commit
937909b19c
2 changed files with 2 additions and 3 deletions
|
|
@ -1,7 +1,6 @@
|
|||
import { PureComponent } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import ReactDOM from 'react-dom';
|
||||
import classnames from 'classnames';
|
||||
|
||||
class Modal extends PureComponent {
|
||||
constructor(props) {
|
||||
|
|
@ -19,7 +18,7 @@ class Modal extends PureComponent {
|
|||
}
|
||||
|
||||
render() {
|
||||
this.modalElement.className = classnames('modal-container', this.props.className);
|
||||
this.modalElement.className = this.props.className;
|
||||
this.modalElement.onclick = this.props.onRequestClose;
|
||||
return ReactDOM.createPortal(this.props.children, this.modalElement);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ class Popup extends Component {
|
|||
}
|
||||
|
||||
return (
|
||||
<Modal onRequestClose={this.close}>
|
||||
<Modal className={'modal-container'} onRequestClose={this.close}>
|
||||
<div ref={this.menuRef} style={this.state.menuStyle} className={styles['menu-container']} onClick={this.menuContainerOnClick}>
|
||||
{children}
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue