Skip to content

Commit

Permalink
user map for driver
Browse files Browse the repository at this point in the history
  • Loading branch information
Satora1 committed Oct 18, 2024
1 parent f871c3c commit 0057e52
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 10 deletions.
12 changes: 6 additions & 6 deletions app/(root)/(tabs)/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,15 @@ export default function Page() {
)}
ListHeaderComponent={() => (
<>
<View className='flex flex-row items-center justify-between my-5'>
<Text className='text-2xl capitalize font-JakartaExtraBold'>
Welcome {user?.firstName || user?.emailAddresses[0].emailAddress.split("@")[0]}{" "}
<View className="flex flex-row items-center justify-between my-5">
<Text className="text-2xl font-JakartaExtraBold">
Welcome {user?.firstName}👋
</Text>
<TouchableOpacity
onPress={handleSignOut}
className='jsutify-center items-center
w-10 h-10 rounded-full bg-white'>
<Image source={icons.out} className='w-4 h-4' />
className="justify-center items-center w-10 h-10 rounded-full bg-white"
>
<Image source={icons.out} className="w-4 h-4" />
</TouchableOpacity>
</View>
<GoogleTextInput
Expand Down
4 changes: 4 additions & 0 deletions app/(root)/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ const Layout=()=> {
return (
<Stack>
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
<Stack.Screen name="find-ride" options={{ headerShown: false }} />
<Stack.Screen name="confirm-ride" options={{ headerShown: false }} />
<Stack.Screen name="book-ride" options={{ headerShown: false }} />

</Stack>
);
}
Expand Down
9 changes: 5 additions & 4 deletions app/(root)/find-ride.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import RideLayout from "@/components/RideLayout"
import { useLocationStore } from "@/store"
import { Text, View } from "react-native"

const FindRide = () => {
const { userAddress, destinationAddress, setDestinationLocation, setUserLocation } = useLocationStore()
return (
< View >
<Text className="text-2xl">You are here:{userAddress}</Text>
<Text className="text-2xl">You are going to:{destinationAddress}</Text>
</View >
< RideLayout >
<Text className="text-2xl">Find Ride</Text>

</RideLayout >
)

}
Expand Down
30 changes: 30 additions & 0 deletions components/RideLayout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { icons } from "@/constants"
import { router } from "expo-router"
import { Image, Text, TouchableOpacity, View } from "react-native"
import { GestureHandlerRootView } from "react-native-gesture-handler"
import Map from "@/components/map";

const RideLayout = ({ title, children }: { title: string, children: React.ReactNode }) => {
return (
<GestureHandlerRootView>
<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">
{title||"Go Back"}
</Text>

</View>
<Map/>
</View>
</View>
</GestureHandlerRootView>
)

}
export default RideLayout

0 comments on commit 0057e52

Please sign in to comment.