about summary refs log tree commit diff
path: root/src/components/Dialog/types.ts
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2024-02-19 18:18:13 -0600
committerGitHub <noreply@github.com>2024-02-19 18:18:13 -0600
commitb52a742925cff4429885e94815d61f3f7cfb5a66 (patch)
tree49382c8b4e9758948e8c553bf9fa6e01d17df112 /src/components/Dialog/types.ts
parentda62a77f05258ce2b0609248cb5677c2406a4e63 (diff)
downloadvoidsky-b52a742925cff4429885e94815d61f3f7cfb5a66.tar.zst
Improve dialogs (#2933)
* Improve dialogs

* Remove comment, revert storybook

* Hacky fix

* Comments
Diffstat (limited to 'src/components/Dialog/types.ts')
-rw-r--r--src/components/Dialog/types.ts21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/components/Dialog/types.ts b/src/components/Dialog/types.ts
index d36784183..00178926a 100644
--- a/src/components/Dialog/types.ts
+++ b/src/components/Dialog/types.ts
@@ -1,15 +1,27 @@
 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
+  open: (options?: DialogControlOpenOptions) => void
   close: () => void
 }
 
@@ -26,10 +38,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