From 20580c58df353e9eaa307efb2d5e872bb0a7d19f Mon Sep 17 00:00:00 2001 From: Sanidhya Kumar Verma Date: Wed, 4 Sep 2024 06:49:05 +0000 Subject: [PATCH] book ride screen implemented --- app/(root)/_layout.tsx | 2 +- app/(root)/book-ride.tsx | 90 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 app/(root)/book-ride.tsx diff --git a/app/(root)/_layout.tsx b/app/(root)/_layout.tsx index dad717d..01142a2 100644 --- a/app/(root)/_layout.tsx +++ b/app/(root)/_layout.tsx @@ -6,7 +6,7 @@ const RootLayout = () => { - {/* */} + ); }; diff --git a/app/(root)/book-ride.tsx b/app/(root)/book-ride.tsx new file mode 100644 index 0000000..a57f203 --- /dev/null +++ b/app/(root)/book-ride.tsx @@ -0,0 +1,90 @@ +import { Image, Text, View } from "react-native"; + +import { RideLayout } from "@/components/ride-layout"; +import { icons } from "@/constants"; +import { formatTime } from "@/lib/utils"; +import { useDriverStore, useLocationStore } from "@/store"; + +const BookRide = () => { + const { userAddress, destinationAddress } = useLocationStore(); + const { drivers, selectedDriver } = useDriverStore(); + + const driverDetails = drivers?.filter( + (driver) => +driver.id === selectedDriver, + )[0]; + + return ( + + <> + + Ride Information + + + + + + + + {driverDetails?.title} + + + + + + {driverDetails?.rating} + + + + + + + + Ride Price + + ${driverDetails?.price} + + + + + Pickup Time + + {formatTime(driverDetails?.time!)} + + + + + Car Seats + + {driverDetails?.car_seats} + + + + + + + + + {userAddress} + + + + + + + {destinationAddress} + + + + + + ); +}; + +export default BookRide;