Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/core/src/components/BottomSheet/BottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import BottomSheetComponent, {
} from "@gorhom/bottom-sheet";
import { useTheme } from "@draftbit/theme";
import { extractPercentNumber, useDeepCompareMemo } from "../../utilities";
import { ReduceMotion } from "react-native-reanimated";

type SnapPosition = "top" | "middle" | "bottom";

Expand All @@ -38,6 +39,7 @@ export interface BottomSheetProps extends ScrollViewProps {
enableDynamicSizing?: boolean;
onSettle?: (index: number) => void;
style?: StyleProp<ViewStyle>;
ignoreReduceMotion?: boolean;
}

// Clarification:
Expand All @@ -61,6 +63,7 @@ const BottomSheet = React.forwardRef<BottomSheetComponent, BottomSheetProps>(
onSettle,
style,
children,
ignoreReduceMotion = true,
...rest
},
ref
Expand Down Expand Up @@ -119,6 +122,9 @@ const BottomSheet = React.forwardRef<BottomSheetComponent, BottomSheetProps>(
? onSettle?.(mappedSnapPoints.length - index)
: onSettle?.(mappedSnapPoints.length - index - 1)
}
overrideReduceMotion={
ignoreReduceMotion ? ReduceMotion.Never : ReduceMotion.System
}
>
<BottomSheetScrollView
contentContainerStyle={[styles.contentContainerStyle, style]}
Expand Down
Loading