diff options
author | Hailey <me@haileyok.com> | 2024-03-19 08:14:29 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-19 08:14:29 -0700 |
commit | 2a5b0ab2acb707a9d87da9e8da403d54734d72e8 (patch) | |
tree | d6db17ccdf92dee4573b918968c0c898a47a60e9 /src/components | |
parent | 8ac5144a584450f037771de4da775d545b70ffa3 (diff) | |
download | voidsky-2a5b0ab2acb707a9d87da9e8da403d54734d72e8.tar.zst |
add `Partial<GestureResponderEvent>` to `.open()` (#3227)
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/Dialog/types.ts | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/components/Dialog/types.ts b/src/components/Dialog/types.ts index 9e7ad3c04..b1a46f853 100644 --- a/src/components/Dialog/types.ts +++ b/src/components/Dialog/types.ts @@ -1,5 +1,5 @@ import React from 'react' -import type {AccessibilityProps} from 'react-native' +import type {AccessibilityProps, GestureResponderEvent} from 'react-native' import {BottomSheetProps} from '@gorhom/bottom-sheet' import {ViewStyleProp} from '#/alf' @@ -10,9 +10,15 @@ type A11yProps = Required<AccessibilityProps> * Mutated by useImperativeHandle to provide a public API for controlling the * dialog. The methods here will actually become the handlers defined within * the `Dialog.Outer` component. + * + * `Partial<GestureResponderEvent>` here allows us to add this directly to the + * `onPress` prop of a button, for example. If this type was not added, we + * would need to create a function to wrap `.open()` with. */ export type DialogControlRefProps = { - open: (options?: DialogControlOpenOptions) => void + open: ( + options?: DialogControlOpenOptions & Partial<GestureResponderEvent>, + ) => void close: (callback?: () => void) => void } |