2
0

🐛 (editor) Fix popover zIndex

This commit is contained in:
Baptiste Arnaud
2023-01-06 15:03:39 +01:00
parent fadf34ad61
commit 2d20f1c41c
7 changed files with 35 additions and 9 deletions

View File

@ -0,0 +1,17 @@
import { createContext, ReactNode, useContext, useRef } from 'react'
const parentModalContext = createContext<{
ref?: React.MutableRefObject<HTMLDivElement | null>
}>({})
export const ParentModalProvider = ({ children }: { children: ReactNode }) => {
const ref = useRef<HTMLDivElement | null>(null)
return (
<parentModalContext.Provider value={{ ref }}>
{children}
</parentModalContext.Provider>
)
}
export const useParentModal = () => useContext(parentModalContext)