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 deviceUse the whole app
import { TravelApp } from '@patine-ui/pro';
<TravelApp />;
| Prop | Type | Default |
|---|---|---|
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
| Screen | What it does |
|---|---|
ExploreScreen | A flight search, trending places in a Carousel, trips by kind |
DestinationScreen | Why go, flight time and price, rain and highs by month on a ComboChart with two axes |
FlightsScreen | Prices by day, filters on a ToggleGroup, flights as cards with stops and CO₂ |
BookFlightScreen | Pro's Wizard with passport validation, a seat map, extras and review |
BoardingPassScreen | A ticket with a QRCode and the travel day on Pro's Timeline |
TripScreen | The trip cover and Pro's Agenda itinerary |
TravelAssistantScreen | Pro's Chat with streamed markdown answers and suggestions |
ExpensesScreen | A 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:
- AI chat PRO
- Agenda PRO
- App shell and layout PRO
- Brand logos PRO
- Combo chart PRO
- Pie chart PRO
- Timeline PRO
- Wizard 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);