This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from "react"; | |
| import { StyleSheet, TextInput } from "react-native"; | |
| import { SafeAreaView, SafeAreaProvider } from "react-native-safe-area-context"; | |
| /** | |
| * Formats a text input as currency-like text while typing. | |
| * - Keeps only digits + one dot | |
| * - Allows ".5" -> "0.5" | |
| * - Limits decimals to 2 | |
| * - Adds thousands separators to the integer part |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const [routeCoordinates, setRouteCoordinates] = useState([]); | |
| useEffect(() => { | |
| const getRoute = async () => { | |
| const apiKey = process.env.EXPO_PUBLIC_googleMaps_ApiKey; | |
| let userCoordinates = null; | |
| try { | |
| const location = await Location.getLastKnownPositionAsync(); | |
| userCoordinates = location; | |
| } catch (error) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as React from "react"; | |
| function isShallowEqual(object1, object2) { | |
| const keys1 = Object.keys(object1); | |
| const keys2 = Object.keys(object2); | |
| if (keys1.length !== keys2.length) { | |
| return false; | |
| } |