mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-31 03:28:49 +00:00
Popup decoupled from app
This commit is contained in:
parent
a06423f0ec
commit
3732b1e427
3 changed files with 4 additions and 2 deletions
|
|
@ -1,10 +1,11 @@
|
|||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import classnames from 'classnames';
|
||||
import { FocusableProvider } from 'stremio-common';
|
||||
|
||||
const Modal = (props) => ReactDOM.createPortal(
|
||||
<FocusableProvider>
|
||||
<div {...props} />
|
||||
<div {...props} className={classnames(Modal.className, props.className)} />
|
||||
</FocusableProvider>,
|
||||
Modal.container
|
||||
);
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@ class Popup extends Component {
|
|||
}
|
||||
|
||||
return (
|
||||
<Modal className={classnames('modal-container', this.props.className)} onClick={this.close}>
|
||||
<Modal className={this.props.className} onClick={this.close}>
|
||||
<div ref={this.menuContainerRef} className={styles['menu-container']} onClick={this.menuContainerOnClick}>
|
||||
<div ref={this.menuScrollRef} className={styles['menu-scroll-container']}>
|
||||
{React.cloneElement(children, { ref: this.menuChildrenRef })}
|
||||
|
|
|
|||
|
|
@ -6,5 +6,6 @@ import App from './app';
|
|||
const container = document.getElementById('app');
|
||||
|
||||
Modal.container = container;
|
||||
Modal.className = 'modal-container';
|
||||
|
||||
ReactDOM.render(<App />, container);
|
||||
|
|
|
|||
Loading…
Reference in a new issue