@@ -18,6 +18,7 @@ import { mergeRefs } from '../utils/merge-refs';
1818interface DraggableModalOptions {
1919 isOpen ?: boolean ;
2020 onClose ?: ( ) => void ;
21+ isScrollable ?: boolean ;
2122 scrollViewProps ?: BottomSheetScrollViewProps ;
2223}
2324
@@ -35,7 +36,15 @@ export const DraggableModal = forwardRef<
3536 const { colorMode } = useColorMode ( ) ;
3637
3738 const bottomSheetModalRef = mergeRefs ( _ref , ref ) ;
38- const { children, isOpen, onClose, h, scrollViewProps, ...rest } = props ;
39+ const {
40+ children,
41+ isOpen,
42+ onClose,
43+ h,
44+ isScrollable,
45+ scrollViewProps,
46+ ...rest
47+ } = props ;
3948
4049 useEffect ( ( ) => {
4150 if ( isOpen ) {
@@ -86,6 +95,15 @@ export const DraggableModal = forwardRef<
8695 const safeAreaViewStyle = {
8796 flex : 1 ,
8897 } ;
98+
99+ const modalContent = (
100+ < Box h = { h ?? '100%' } >
101+ < SafeAreaView style = { safeAreaViewStyle } >
102+ { children as ReactNode }
103+ </ SafeAreaView >
104+ </ Box >
105+ ) ;
106+
89107 return (
90108 < ficus . BottomSheetModal
91109 ref = { bottomSheetModalRef }
@@ -95,15 +113,13 @@ export const DraggableModal = forwardRef<
95113 backgroundStyle = { bottomSheetBackgroundStyleObject as ViewStyle }
96114 handleIndicatorStyle = { handleStyleObject }
97115 >
98- < BottomSheetScrollView { ...scrollViewProps } >
99- < ficus . BottomSheetView { ...rest } >
100- < Box h = { h ?? '100%' } >
101- < SafeAreaView style = { safeAreaViewStyle } >
102- { children as ReactNode }
103- </ SafeAreaView >
104- </ Box >
105- </ ficus . BottomSheetView >
106- </ BottomSheetScrollView >
116+ { isScrollable ? (
117+ < BottomSheetScrollView { ...scrollViewProps } >
118+ { modalContent }
119+ </ BottomSheetScrollView >
120+ ) : (
121+ < ficus . BottomSheetView { ...rest } > { modalContent } </ ficus . BottomSheetView >
122+ ) }
107123 </ ficus . BottomSheetModal >
108124 ) ;
109125} ) ;
0 commit comments