Uber 2.0 clone with REACT NATIVE
A copy of the Uber app to learn and improve coding skills with the React Native platform.
What I have learned is how to use:
- Tailwind CSS with RN for styling
- React Redux for managing and centralizing application state
- React Native Navigation to navigate between screens
- React Native Elements as a styling library with pre-built components that build upon React Native components
- Google Autocomplete as a feature in which an application predicts the rest of a word a user is typing
- Google Directions API for real navigation
- Google Distance Matrix API to calculate Travel time, Distance and Cost!
- React Native Map components for iOS + Android
- React Native Vector Icons a set of icons for buttons, logos and nav/tab bars
Dependencies
- Redux Toolkit link
- React Redux
- Tailwind React Native Classnames
- React Native Elements
- React Native Vector Icons
- React Native Safe Area Context
- React Navigation Native
- React Native Screens
- Native Stack Navigator (@react-navigation/native-stack)
- react-native-google-places-autocomplete
- React Native Dotenv
- React Native Maps
- React Native Maps Directions
Note: let's use expo to install react-native-screens react-native-safe-area-context
App overview

The Distance Matrix API to get travel distance and time for a matrix of origins and destinations
const getTravelTime = async () => {
fetch(`https://maps.googleapis.com/maps/api/distancematrix/json?
units=imperial&origins=${origin.description}
&destinations=${destination.description}&key=${GOOGLE_MAPS_APIKEY}`)
.then((res) => res.json())
.then(data => {
dispatch(setTravelTimeInformation(data.rows[0].elements[0]));
})
};
In order to convert the price using ES6
{new Intl.NumberFormat("en-gb", {
style: "currency",
currency: "USD"
}).format((travelTimeInformation?.duration?.value * SURGE_CHANGE_RATE * multiplier) / 100)
}