From a18da78b333863d851d1b57f8315bc8a85a3bf23 Mon Sep 17 00:00:00 2001 From: LukasFridmansky Date: Thu, 10 Aug 2023 09:08:52 +0200 Subject: [PATCH] fix: containerProps attribute --- README.md | 1 + src/components/SwipeModal/index.tsx | 3 ++- src/core/dto/swipeModalDTO.ts | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9784f62..616329b 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,7 @@ export default YourComponent; `animationDuration` | number | 300 | The duration of the modal's opening and closing animations, in milliseconds. `closeSpaceVisibility` | number (0 - 1) | 0.6 | A number representing the opacity of empty space, that will close the modal if `closeOnEmptySpace` is enabled. `topOffset` | number | 0 | Determines the amount of space that the swipeable content will be offset from the top edge of window. + `containerProps` | ViewProps | | Additional props to be applied to the container. ## Public Methods diff --git a/src/components/SwipeModal/index.tsx b/src/components/SwipeModal/index.tsx index 7f584b8..5d5bca1 100644 --- a/src/components/SwipeModal/index.tsx +++ b/src/components/SwipeModal/index.tsx @@ -54,6 +54,7 @@ const SwipeModal = forwardRef( ( { footerComponent, disableSwipe = false, topOffset = 0, + containerProps, ...props }, ref ) => { @@ -190,7 +191,7 @@ const SwipeModal = forwardRef( ( { useEffect( () => onHeightChange(), [ maxHeight ] ); const modalChildren = ( - + {showBar && ( diff --git a/src/core/dto/swipeModalDTO.ts b/src/core/dto/swipeModalDTO.ts index db2c43f..63d2702 100644 --- a/src/core/dto/swipeModalDTO.ts +++ b/src/core/dto/swipeModalDTO.ts @@ -1,5 +1,5 @@ import { ReactNode } from 'react'; -import { ViewStyle } from 'react-native'; +import { ViewProps, ViewStyle } from 'react-native'; import { ScrollView } from 'react-native-gesture-handler'; import { SharedValue } from 'react-native-reanimated'; import { AnimatedModalProps } from './animatedModalDTO'; @@ -22,6 +22,7 @@ export interface SwipeModalProps extends AnimatedModalProps { footerComponent?: ReactNode; disableSwipe?: boolean; topOffset?: number; + containerProps?: ViewProps; } export type SwipeModalPublicMethods = {