From 0057e5228ddb6c27bc2077980831cc6656e39b17 Mon Sep 17 00:00:00 2001 From: Jakub Satora Date: Fri, 18 Oct 2024 19:32:07 +0200 Subject: [PATCH] user map for driver --- app/(root)/(tabs)/home.tsx | 12 ++++++------ app/(root)/_layout.tsx | 4 ++++ app/(root)/find-ride.tsx | 9 +++++---- components/RideLayout.tsx | 30 ++++++++++++++++++++++++++++++ 4 files changed, 45 insertions(+), 10 deletions(-) create mode 100644 components/RideLayout.tsx diff --git a/app/(root)/(tabs)/home.tsx b/app/(root)/(tabs)/home.tsx index a3174b0..fb653c9 100644 --- a/app/(root)/(tabs)/home.tsx +++ b/app/(root)/(tabs)/home.tsx @@ -169,15 +169,15 @@ export default function Page() { )} ListHeaderComponent={() => ( <> - - - Welcome {user?.firstName || user?.emailAddresses[0].emailAddress.split("@")[0]}{" "} + + + Welcome {user?.firstName}👋 - + className="justify-center items-center w-10 h-10 rounded-full bg-white" + > + { return ( + + + + ); } diff --git a/app/(root)/find-ride.tsx b/app/(root)/find-ride.tsx index 497a716..b975cfe 100644 --- a/app/(root)/find-ride.tsx +++ b/app/(root)/find-ride.tsx @@ -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 > - You are here:{userAddress} - You are going to:{destinationAddress} - + < RideLayout > + Find Ride + + ) } diff --git a/components/RideLayout.tsx b/components/RideLayout.tsx new file mode 100644 index 0000000..441c016 --- /dev/null +++ b/components/RideLayout.tsx @@ -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 ( + + + + + router.back()}> + + + + + + {title||"Go Back"} + + + + + + + + ) + +} +export default RideLayout \ No newline at end of file