diff options
author | Jan-Olof Eriksson <jan-olof.eriksson@iki.fi> | 2024-02-21 13:22:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-21 13:22:13 +0200 |
commit | 38fd4282f88ac020ee72d5a6324191ee80798450 (patch) | |
tree | 18f713fed78387f1cb83ac0818b4f1333fad6db8 /src/components/Dialog/types.ts | |
parent | 1269e76071ea7c79b93d1a58e80b74746c71ecd9 (diff) | |
parent | f88b16525498584f81ea7f594a63623fc5dc7ce9 (diff) | |
download | voidsky-38fd4282f88ac020ee72d5a6324191ee80798450.tar.zst |
Merge branch 'bluesky-social:main' into main
Diffstat (limited to 'src/components/Dialog/types.ts')
-rw-r--r-- | src/components/Dialog/types.ts | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/src/components/Dialog/types.ts b/src/components/Dialog/types.ts index d36784183..75ba825ac 100644 --- a/src/components/Dialog/types.ts +++ b/src/components/Dialog/types.ts @@ -1,24 +1,34 @@ import React from 'react' -import type {ViewStyle, AccessibilityProps} from 'react-native' +import type {AccessibilityProps} from 'react-native' import {BottomSheetProps} from '@gorhom/bottom-sheet' +import {ViewStyleProp} from '#/alf' + type A11yProps = Required<AccessibilityProps> export type DialogContextProps = { close: () => void } +export type DialogControlOpenOptions = { + /** + * NATIVE ONLY + * + * Optional index of the snap point to open the bottom sheet to. Defaults to + * 0, which is the first snap point (i.e. "open"). + */ + index?: number +} + export type DialogControlProps = { - open: (index?: number) => void - close: () => void + open: (options?: DialogControlOpenOptions) => void + close: (callback?: () => void) => void } export type DialogOuterProps = { control: { ref: React.RefObject<DialogControlProps> - open: (index?: number) => void - close: () => void - } + } & DialogControlProps onClose?: () => void nativeOptions?: { sheet?: Omit<BottomSheetProps, 'children'> @@ -26,10 +36,7 @@ export type DialogOuterProps = { webOptions?: {} } -type DialogInnerPropsBase<T> = React.PropsWithChildren<{ - style?: ViewStyle -}> & - T +type DialogInnerPropsBase<T> = React.PropsWithChildren<ViewStyleProp> & T export type DialogInnerProps = | DialogInnerPropsBase<{ label?: undefined |