Open History to see the last commit
1import { useState } from "react";
2import { View } from "react-native";
3import { FormSheet } from "react-native-screens";
4import { useResolveClassNames } from "uniwind";
5import { AndroidSheetHeader } from "./AndroidScreenHeader";
6import type { SheetProps } from "./Sheet.types";
7export type { SheetProps } from "./Sheet.types";
8
9export function Sheet(props: SheetProps) {
10 const containerStyle = useResolveClassNames("bg-sheet");
11 const [isOpen, setIsOpen] = useState(true);
12 return (
13 <FormSheet
14 isOpen={isOpen}
15 detents={[0.5, 0.9]}
16 prefersGrabberVisible
17 nativeContainerStyle={containerStyle}
18 onDismiss={props.onClose}
19 onNativeDismiss={props.onClose}
20 >
21 <View collapsable={false} className="flex-1 bg-sheet">
22 <AndroidSheetHeader title={props.title} onBack={() => setIsOpen(false)} />
23 {props.children}
24 </View>
25 </FormSheet>
26 );
27}