Skip to main content

Delivery tracking Pro

Live delivery tracking for the person waiting, as Uber Eats and Wolt show it. The courier rides the route with their heading, the part already ridden fades, and the camera keeps courier and door in frame; move the map to look around, then tap Re-centre. Above it: the step in words, a countdown and arrival time, the courier to call or message, the pickup and door, and the order. Once it's delivered, rate the courier, add compliments and a tip. On desktops the details sit beside the map; on phones they live in a sheet over it.

Built from MapView (MapMarker, MapRoute, MapSheet) and free components.

import { CourierTrackingScreen } from '@patine-ui/pro';

<CourierTrackingScreen />;
Loading…
<View style={{ width: '100%', height: 680 }}>
  <CourierTrackingScreen />
</View>

Make it yours​

PropTypeDefault
tripTripPlan: from, to, courier, items, total, approach and route (coordinates), prepare, pickupDwell, speed, arrivingDEMO_TRIP, a Hackney order by e-bike
speednumber: seconds of the trip per second8 in the demo; pass 1 with a live feed
startAtnumber: seconds into the trip it opens at300
onCall() => voidDials the courier
onChat() => voidOpen your chat
onRate({ stars, tip, compliments }) => void
onBack() => void: shows a back button
onHelp() => void

tripState(trip, t) says where a delivery is t seconds after the order: the step (TRIP_STEPS), the courier's place and heading, and the seconds and metres left. With real GPS, copy the screen and feed the courier's position to the marker instead.

The map opens on OpenStreetMap's tiles, which suit development. For production, pass a provider's URL with your key to MapView (see Tiles).

Built with​

The free components, from patine-ui:

Avatar · Button · Rating · SegmentedControl · Separator · Text

And from Patine Pro:

Files​

courier/
├── components/
│ ├── CourierCard.tsx
│ ├── Pins.tsx
│ ├── RateTrip.tsx
│ └── TripStatus.tsx
├── hooks/
│ └── useTrip.ts
├── courier.constants.ts
├── courier.types.ts
├── courier.utils.ts
├── CourierTrackingScreen.tsx
└── index.ts

A look at the code​

The countdown and arrival time, from courier.utils.ts:

/** Seconds as the countdown shows them: "12 min", "1 min", then "Now". */
export const formatEta = (seconds: number) => {
if (seconds < 45) return 'Now';
return `${Math.max(1, Math.round(seconds / 60))} min`;
};

/** A time of day as a 24-hour clock, as UK apps show it: "19:58". */
export const formatArrival = (from: Date, seconds: number) => {
const d = new Date(from.getTime() + seconds * 1000);
return `${String(d.getHours()).padStart(2, '0')}:${String(d.getMinutes()).padStart(2, '0')}`;
};
Get the source with Pro

Accessibility​

  • The status is a live region: "Sam is on the way. Arriving in 12 min, at 19:58".
  • The steps are a progress bar named "Step 4 of 6: On the way".
  • The courier pin and both places are named on the map.
  • Compliments are checkboxes; the rating and tip are labelled controls.