add constant for zIndex

This commit is contained in:
Gabriel Borlea 2023-03-07 13:35:04 +02:00
parent e3a546f08e
commit f338ae0ae4
2 changed files with 5 additions and 1 deletions

View File

@ -3,6 +3,7 @@ import ReactDOM from 'react-dom';
import { useSelector } from 'react-redux';
import { IReduxState } from '../../../app/types';
import { ZINDEX_DIALOG_PORTAL } from '../../constants';
type Props = {
@ -65,7 +66,7 @@ function DialogPortal({ children, className, style, getRef, setSize }: Props) {
useEffect(() => {
if (portalTarget && getRef) {
getRef(portalTarget);
portalTarget.style.zIndex = '300';
portalTarget.style.zIndex = `${ZINDEX_DIALOG_PORTAL}`;
}
}, [ portalTarget ]);

View File

@ -38,3 +38,6 @@ export const NOTIFY_CLICK_MODE = {
ONLY_NOTIFY: 'ONLY_NOTIFY',
PREVENT_AND_NOTIFY: 'PREVENT_AND_NOTIFY'
};
// Around 300 to be displayed above components like chat
export const ZINDEX_DIALOG_PORTAL = 300;