Skip to main content

Travel: Wander Pro

Wander plans and books trips with friends. The seat map is plain views, the boarding pass a QRCode, and the planner streams answers through Pro's Chat.

See it live, on any device

Use the whole app​

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

<TravelApp />;
PropTypeDefault
initialRoute'explore' | 'destination' | 'flights' | 'book' | 'pass' | 'trip' | 'assistant' | 'expenses''explore'
demo'ready' | 'loading' | 'empty' | 'error''ready'
insets{ top, bottom }None
platform'ios' | 'android' | 'web'Platform.OS

Screens move the platform's way: on iOS a pushed screen slides in from the trailing edge, on Android they fade through, on the web and between tabs they fade in. Reduce motion turns it off.

Screens​

ScreenWhat it does
ExploreScreenA flight search, trending places in a Carousel, trips by kind
DestinationScreenWhy go, flight time and price, rain and highs by month on a ComboChart with two axes
FlightsScreenPrices by day, filters on a ToggleGroup, flights as cards with stops and CO₂
BookFlightScreenPro's Wizard with passport validation, a seat map, extras and review
BoardingPassScreenA ticket with a QRCode and the travel day on Pro's Timeline
TripScreenThe trip cover and Pro's Agenda itinerary
TravelAssistantScreenPro's Chat with streamed markdown answers and suggestions
ExpensesScreenA DonutChart by kind, the fewest payments to settle up, every expense

Every screen is exported on its own, takes its data as props, and has sample data as defaults. filterFlights(flights, filters) filters and sorts by price; settleUp(expenses, people) works out who pays whom.

Built with​

The free components, from patine-ui:

Avatar · AvatarGroup · Badge · Button · Card · Carousel · Checkbox · ChipGroup · DescriptionList · EmptyState · Heading, Text · List, ListItem · Progress · QRCode · Stat · TextField · ToggleGroup

And from Patine Pro:

Files​

travel/
├── hooks/
│ └── useTravel.ts
├── BoardingPassScreen.tsx
├── BookFlightScreen.tsx
├── DestinationScreen.tsx
├── ExpensesScreen.tsx
├── ExploreScreen.tsx
├── FlightsScreen.tsx
├── index.ts
├── travel.constants.ts
├── travel.utils.ts
├── TravelApp.tsx
├── TravelAssistantScreen.tsx
└── TripScreen.tsx

It also uses shared/, the theme, money formatting and screen transitions every Pro app shares.

A look at the code​

Prices in euros and the flight filters, from travel.utils.ts:

/** Whole euros: €148. */
export const eur = (euros: number) => `€${Math.round(euros).toLocaleString('en-IE')}`;

/** Flights the filters leave, cheapest first: nonstop, leaving before noon, under €150. */
export const filterFlights = (flights: readonly FlightOption[], filters: readonly string[]) =>
flights
.filter((f) => !filters.includes('nonstop') || f.stops === 0)
.filter((f) => !filters.includes('morning') || Number(f.depart.slice(0, 2)) < 12)
.filter((f) => !filters.includes('cheap') || f.price < 150)
.sort((a, b) => a.price - b.price);
Get the source with Pro