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 }) => {
return ReactDOM.createPortal(
<FocusableProvider onModalsContainerDomTreeChange={onModalsContainerDomTreeChange}>
<div className={'modal-container'}>
{children}
</div>
<div>{children}</div>
</FocusableProvider>,
modalsContainer
);

View file

@ -237,7 +237,7 @@ class Popup extends Component {
return (
<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.menuScrollRef} className={styles['menu-scroll-container']}>
{React.cloneElement(children, { ref: this.menuChildrenRef })}

View file

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

View file

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