Skip to content
Source
Sign inSign up

PaneSheet.tsx

21 lines781 Bytes

1import { View } from "react-native";
2import { FormSheet } from "react-native-screens";
3import { useResolveClassNames } from "uniwind";
4​
5import { BottomSheetContext } from "./BottomSheetContext";
6import type { PaneSheetProps } from "./PaneSheet.types";
7export type { PaneSheetProps } from "./PaneSheet.types";
8​
9/** A native sheet holding a pane that draws its own bar. */
10export function PaneSheet({ children, ...props }: PaneSheetProps) {
11 const containerStyle = useResolveClassNames("bg-sheet");
12 return (
13 <FormSheet {...props} prefersGrabberVisible nativeContainerStyle={containerStyle}>
14 <BottomSheetContext value>
15 <View collapsable={false} className="flex-1 bg-sheet">
16 {children}
17 </View>
18 </BottomSheetContext>
19 </FormSheet>
20 );