diff options
author | Samuel Newman <mozzius@protonmail.com> | 2024-03-19 19:51:35 +0000 |
---|---|---|
committer | Samuel Newman <mozzius@protonmail.com> | 2024-03-19 19:51:35 +0000 |
commit | 4794ab6b9a39d06bb0d1b7c64a315e4ac5e3336a (patch) | |
tree | 743b94dff5a4a3b4b2304c53b984b8a3dc67aaa2 /src/components/Dialog | |
parent | a1c4f19731878f7026d398d28e475bbeb7de824a (diff) | |
parent | 5621c8042510c86f6c4fa63b5c5ce9fc02b0bf8e (diff) | |
download | voidsky-4794ab6b9a39d06bb0d1b7c64a315e4ac5e3336a.tar.zst |
Merge remote-tracking branch 'origin/main' into samuel/alf-login
Diffstat (limited to 'src/components/Dialog')
-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 } |