diff options
Diffstat (limited to 'src/components/Dialog/index.tsx')
-rw-r--r-- | src/components/Dialog/index.tsx | 44 |
1 files changed, 29 insertions, 15 deletions
diff --git a/src/components/Dialog/index.tsx b/src/components/Dialog/index.tsx index 93acad438..46c072ce4 100644 --- a/src/components/Dialog/index.tsx +++ b/src/components/Dialog/index.tsx @@ -40,6 +40,7 @@ import { import {BottomSheetNativeComponent} from '../../../modules/bottom-sheet/src/BottomSheetNativeComponent' export {useDialogContext, useDialogControl} from '#/components/Dialog/context' +export * from '#/components/Dialog/shared' export * from '#/components/Dialog/types' export * from '#/components/Dialog/utils' // @ts-ignore @@ -169,25 +170,31 @@ export function Outer({ ) } -export function Inner({children, style}: DialogInnerProps) { +export function Inner({children, style, header}: DialogInnerProps) { const insets = useSafeAreaInsets() return ( - <View - style={[ - a.pt_2xl, - a.px_xl, - { - paddingBottom: insets.bottom + insets.top, - }, - style, - ]}> - {children} - </View> + <> + {header} + <View + style={[ + a.pt_2xl, + a.px_xl, + { + paddingBottom: insets.bottom + insets.top, + }, + style, + ]}> + {children} + </View> + </> ) } export const ScrollableInner = React.forwardRef<ScrollView, DialogInnerProps>( - function ScrollableInner({children, style, ...props}, ref) { + function ScrollableInner( + {children, style, contentContainerStyle, header, ...props}, + ref, + ) { const {nativeSnapPoint, disableDrag, setDisableDrag} = useDialogContext() const insets = useSafeAreaInsets() const {setEnabled} = useKeyboardController() @@ -232,14 +239,21 @@ export const ScrollableInner = React.forwardRef<ScrollView, DialogInnerProps>( return ( <KeyboardAwareScrollView style={[style]} - contentContainerStyle={[a.pt_2xl, a.px_xl, {paddingBottom}]} + contentContainerStyle={[ + a.pt_2xl, + a.px_xl, + {paddingBottom}, + contentContainerStyle, + ]} ref={ref} {...props} bounces={nativeSnapPoint === BottomSheetSnapPoint.Full} bottomOffset={30} scrollEventThrottle={50} onScroll={isAndroid ? onScroll : undefined} - keyboardShouldPersistTaps="handled"> + keyboardShouldPersistTaps="handled" + stickyHeaderIndices={header ? [0] : undefined}> + {header} {children} </KeyboardAwareScrollView> ) |