drop usage of global class name modal-container

This commit is contained in:
NikolaBorislavovHristov 2019-04-08 16:05:21 +03:00
parent 3d19c828ed
commit ddd546e3df
4 changed files with 15 additions and 17 deletions

View file

@ -11,9 +11,7 @@ const onModalsContainerDomTreeChange = ({ modalsContainerElement, contentElement
const Modal = ({ modalsContainer, children }) => { const Modal = ({ modalsContainer, children }) => {
return ReactDOM.createPortal( return ReactDOM.createPortal(
<FocusableProvider onModalsContainerDomTreeChange={onModalsContainerDomTreeChange}> <FocusableProvider onModalsContainerDomTreeChange={onModalsContainerDomTreeChange}>
<div className={'modal-container'}> <div>{children}</div>
{children}
</div>
</FocusableProvider>, </FocusableProvider>,
modalsContainer modalsContainer
); );

View file

@ -237,7 +237,7 @@ class Popup extends Component {
return ( return (
<Modal> <Modal>
<div className={classnames(styles['modal-container'], this.props.className)} onClick={this.modalBackgroundOnClick}> <div className={classnames(styles['modal-content-container'], this.props.className)} onClick={this.modalBackgroundOnClick}>
<div ref={this.menuContainerRef} className={styles['menu-container']} onClick={this.menuContainerOnClick}> <div ref={this.menuContainerRef} className={styles['menu-container']} onClick={this.menuContainerOnClick}>
<div ref={this.menuScrollRef} className={styles['menu-scroll-container']}> <div ref={this.menuScrollRef} className={styles['menu-scroll-container']}>
{React.cloneElement(children, { ref: this.menuChildrenRef })} {React.cloneElement(children, { ref: this.menuChildrenRef })}

View file

@ -1,4 +1,4 @@
.modal-container { .modal-content-container {
width: 100%; width: 100%;
height: 100%; height: 100%;

View file

@ -1,13 +1,13 @@
.modals-container { .modals-container {
width: 0; width: 0;
height: 0; height: 0;
>:global(.modal-container) { >* {
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
left: 0; left: 0;
z-index: 1; z-index: 1;
} }
} }