diff --git a/native/bottom-sheets/bottom-sheet-backdrop.react.js b/native/bottom-sheets/bottom-sheet-backdrop.react.js new file mode 100644 index 000000000..fbad49370 --- /dev/null +++ b/native/bottom-sheets/bottom-sheet-backdrop.react.js @@ -0,0 +1,40 @@ +// @flow + +import { BottomSheetBackdrop as Backdrop } from '@gorhom/bottom-sheet'; +import * as React from 'react'; +import type { SharedValue } from 'react-native-reanimated'; + +type BackdropPressBehavior = 'none' | 'close' | 'collapse'; + +type Props = { + +animatedIndex: SharedValue, + +animatedPosition: SharedValue, + +opacity?: number, + +appearsOnIndex?: number, + +disappearsOnIndex?: number, + +enableTouchThrough?: boolean, + +pressBehavior?: BackdropPressBehavior | number, +}; + +function BottomSheetBackdrop(props: Props): React.Node { + const { + opacity, + appearsOnIndex, + disappearsOnIndex, + enableTouchThrough, + pressBehavior, + } = props; + + return ( + + ); +} + +export default BottomSheetBackdrop; diff --git a/native/bottom-sheets/bottom-sheet.react.js b/native/bottom-sheets/bottom-sheet.react.js index 4708a72a9..84d1e62ed 100644 --- a/native/bottom-sheets/bottom-sheet.react.js +++ b/native/bottom-sheets/bottom-sheet.react.js @@ -1,54 +1,56 @@ // @flow import { BottomSheetModal } from '@gorhom/bottom-sheet'; import * as React from 'react'; +import BottomSheetBackdrop from './bottom-sheet-backdrop.react.js'; import BottomSheetHandle from './bottom-sheet-handle.react.js'; import { useStyles } from '../themes/colors.js'; type Props = { +children: React.Node, }; function ForwardedBottomSheet( props: Props, ref: React.Ref, ): React.Node { const { children } = props; const styles = useStyles(unboundStyles); const snapPoints = React.useMemo(() => ['25%', '50%'], []); return ( {children} ); } const unboundStyles = { background: { backgroundColor: 'modalForeground', }, }; const BottomSheet: React.AbstractComponent< Props, React.ElementRef, > = React.forwardRef>( ForwardedBottomSheet, ); BottomSheet.displayName = 'BottomSheet'; const MemoizedBottomSheet: typeof BottomSheet = React.memo< Props, React.ElementRef, >(BottomSheet); export default MemoizedBottomSheet;