import Transition from "react-native-screen-transitions";
import { View, Text, FlatList } from "react-native";
import { interpolate } from "react-native-reanimated";
function BottomSheetScreen() {
const items = Array.from({ length: 20 }, (_, i) => ({
id: String(i),
title: `Item ${i + 1}`,
}));
return (
<Transition.ScrollView
style={{ flex: 1, backgroundColor: "#fff" }}
scrollEnabled={true}
bounces={false}
>
<View style={{ paddingTop: 20, paddingHorizontal: 20 }}>
<Text style={{ fontSize: 20, fontWeight: "bold", marginBottom: 20 }}>
Options
</Text>
{items.map((item) => (
<View
key={item.id}
style={{
paddingVertical: 12,
borderBottomWidth: 1,
borderBottomColor: "#eee",
}}
>
<Text>{item.title}</Text>
</View>
))}
</View>
</Transition.ScrollView>
);
}
export const options = {
snapPoints: [0.5, 1],
initialSnapIndex: 0,
screenStyleInterpolator: ({ progress }) => {
"worklet";
return {
contentStyle: {
borderTopLeftRadius: 16,
borderTopRightRadius: 16,
transform: [
{
translateY: interpolate(progress, [0, 1, 2], [600, 0, 600]),
},
],
},
backdropStyle: {
opacity: interpolate(progress, [0, 1, 2], [0, 0.3, 0]),
},
};
},
gestureEnabled: true,
gestureDirection: "vertical",
backdropBehavior: "collapse",
};