forked from adrianhajdin/uber
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRideLayout.tsx
More file actions
76 lines (70 loc) · 2.04 KB
/
RideLayout.tsx
File metadata and controls
76 lines (70 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import BottomSheet, {
BottomSheetScrollView,
BottomSheetView,
} from "@gorhom/bottom-sheet";
import { router } from "expo-router";
import React, { useRef } from "react";
import { Image, Text, TouchableOpacity, View } from "react-native";
import { GestureHandlerRootView } from "react-native-gesture-handler";
import Map from "@/components/Map";
import { icons } from "@/constants";
const RideLayout = ({
title,
snapPoints,
children,
}: {
title: string;
snapPoints?: string[];
children: React.ReactNode;
}) => {
const bottomSheetRef = useRef<BottomSheet>(null);
return (
<GestureHandlerRootView className="flex-1">
<View className="flex-1 bg-white">
<View className="flex flex-col h-screen bg-blue-500">
<View className="flex flex-row absolute z-10 top-16 items-center justify-start px-5">
<TouchableOpacity onPress={() => router.back()}>
<View className="w-10 h-10 bg-white rounded-full items-center justify-center">
<Image
source={icons.backArrow}
resizeMode="contain"
className="w-6 h-6"
/>
</View>
</TouchableOpacity>
<Text className="text-xl font-JakartaSemiBold ml-5">
{title || "Go Back"}
</Text>
</View>
<Map />
</View>
<BottomSheet
ref={bottomSheetRef}
snapPoints={snapPoints || ["40%", "85%"]}
index={0}
>
{title === "Choose a Rider" ? (
<BottomSheetView
style={{
flex: 1,
padding: 20,
}}
>
{children}
</BottomSheetView>
) : (
<BottomSheetScrollView
style={{
flex: 1,
padding: 20,
}}
>
{children}
</BottomSheetScrollView>
)}
</BottomSheet>
</View>
</GestureHandlerRootView>
);
};
export default RideLayout;