change(ui): add shared zindex const
This commit is contained in:
parent
2461adf0f5
commit
47b7745b9f
2 changed files with 12 additions and 2 deletions
|
|
@ -4,6 +4,7 @@ import cn from 'classnames';
|
|||
import { Popup } from 'UI';
|
||||
import GuidePopup, { FEATURE_KEYS } from 'Shared/GuidePopup';
|
||||
import { Controls as Player } from 'Player';
|
||||
import { INDEXES } from 'App/constants/zIndex';
|
||||
|
||||
interface Props {
|
||||
onClick?: () => void;
|
||||
|
|
@ -45,7 +46,7 @@ function XRayButton(props: Props) {
|
|||
<button
|
||||
className={cn(stl.wrapper, { [stl.default]: !isActive, [stl.active]: isActive })}
|
||||
onClick={onClick}
|
||||
style={{ zIndex: 99999, position: 'relative' }}
|
||||
style={{ zIndex: INDEXES.POPUP_GUIDE_BTN, position: 'relative' }}
|
||||
>
|
||||
<span className="z-1">X-RAY</span>
|
||||
</button>
|
||||
|
|
@ -53,7 +54,7 @@ function XRayButton(props: Props) {
|
|||
<div
|
||||
className="absolute bg-white top-0 left-0 z-0"
|
||||
style={{
|
||||
zIndex: 99998,
|
||||
zIndex: INDEXES.POPUP_GUIDE_BG,
|
||||
width: '100px',
|
||||
height: '50px',
|
||||
borderRadius: '30px',
|
||||
|
|
|
|||
9
frontend/app/constants/zindex.ts
Normal file
9
frontend/app/constants/zindex.ts
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
export const INDEXES = {
|
||||
POPUP_GUIDE_BG: 99998,
|
||||
POPUP_GUIDE_BTN: 99999,
|
||||
}
|
||||
|
||||
export const getHighest = () => {
|
||||
const allIndexes = Object.values(INDEXES)
|
||||
return allIndexes[allIndexes.length - 1] + 1
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue