Clean up dialog types
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user