Clean up dialog types

This commit is contained in:
Eric Bailey
2024-01-11 14:56:10 -06:00
parent bf1641d03a
commit 09874504af
5 changed files with 51 additions and 54 deletions
+19
View File
@@ -0,0 +1,19 @@
import React from 'react'
import {DialogContextProps, DialogControlProps} from '#/view/com/Dialog/types'
export const Context = React.createContext<DialogContextProps>({
close: () => {},
})
export function useDialogContext() {
return React.useContext(Context)
}
export function useDialogControl() {
const control = React.useRef<DialogControlProps>({
open: () => {},
close: () => {},
})
return control
}