An ATproto social media client -- with an independent Appview.

add `Partial<GestureResponderEvent>` to `.open()` (#3227)

authored by hailey.at and committed by

GitHub 2a5b0ab2 8ac5144a

+8 -2
+8 -2
src/components/Dialog/types.ts
··· 1 1 import React from 'react' 2 - import type {AccessibilityProps} from 'react-native' 2 + import type {AccessibilityProps, GestureResponderEvent} from 'react-native' 3 3 import {BottomSheetProps} from '@gorhom/bottom-sheet' 4 4 5 5 import {ViewStyleProp} from '#/alf' ··· 10 10 * Mutated by useImperativeHandle to provide a public API for controlling the 11 11 * dialog. The methods here will actually become the handlers defined within 12 12 * the `Dialog.Outer` component. 13 + * 14 + * `Partial<GestureResponderEvent>` here allows us to add this directly to the 15 + * `onPress` prop of a button, for example. If this type was not added, we 16 + * would need to create a function to wrap `.open()` with. 13 17 */ 14 18 export type DialogControlRefProps = { 15 - open: (options?: DialogControlOpenOptions) => void 19 + open: ( 20 + options?: DialogControlOpenOptions & Partial<GestureResponderEvent>, 21 + ) => void 16 22 close: (callback?: () => void) => void 17 23 } 18 24