Skip to content

Commit 8c6abd2

Browse files
feat: create container style prop (#8)
1 parent 10f83ba commit 8c6abd2

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ This is the list of exclusive props that are meant to be used to customise the b
164164
| `animationConfig` | no | `{ duration: number, easing: Animated.EasingFunction }` | Timing configuration for the animation, by default it uses a duration of 250ms and easing fn `Easing.inOut(Easing.linear)` |
165165
| `topInset` | no | `number` | This value is useful to provide an offset (in dp) when applying percentages for snapping points |
166166
| `innerRef` | no | `RefObject` | Ref to the inner scrollable component (ScrollView, FlatList or SectionList), so that you can call its imperative methods. For instance, calling `scrollTo` on a ScrollView. In order to so, you have to use `getNode` as well, since it's wrapped into an _animated_ component: `ref.current.getNode().scrollTo({y: 0, animated: true})` |
167+
| `containerStyle` | no | `StyleProp<ViewStyle>` | Style to be applied to the container (Handle and Content) |
167168

168169

169170
### Inherited

src/index.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import {
1010
SectionListProps,
1111
StyleSheet,
1212
View,
13+
StyleProp,
14+
ViewStyle,
1315
} from 'react-native';
1416
import Animated, {
1517
abs,
@@ -156,6 +158,10 @@ type CommonProps = {
156158
* Reference to FlatList, ScrollView or SectionList in order to execute its imperative methods.
157159
*/
158160
innerRef: RefObject<FlatList | ScrollView | SectionList>;
161+
/*
162+
* Style to be applied to the container.
163+
*/
164+
containerStyle?: StyleProp<ViewStyle>;
159165
};
160166

161167
type Props<T> = CommonProps &
@@ -595,6 +601,7 @@ export class ScrollBottomSheet<T extends any> extends Component<Props<T>> {
595601
componentType,
596602
onSettle,
597603
animatedPosition,
604+
containerStyle,
598605
...rest
599606
} = this.props;
600607
const AnimatedScrollableComponent = this.scrollComponent;
@@ -605,6 +612,7 @@ export class ScrollBottomSheet<T extends any> extends Component<Props<T>> {
605612
<Animated.View
606613
style={[
607614
StyleSheet.absoluteFillObject,
615+
containerStyle,
608616
// @ts-ignore
609617
{
610618
transform: [{ translateY: this.translateY }],

0 commit comments

Comments
 (0)