# React Native travel app template (Pro)

> A complete React Native travel app for iOS, Android and the web: places to explore, weather by month, flight results by price and day, booking with a seat map, a boarding pass with a QR code, an itinerary, an AI trip planner and shared expenses.

# 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

```tsx
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](/docs/components/avatar) · [AvatarGroup](/docs/components/avatar-group) · [Badge](/docs/components/badge) · [Button](/docs/components/button) · [Card](/docs/components/card) · [Carousel](/docs/components/carousel) · [Checkbox](/docs/components/checkbox) · [ChipGroup](/docs/components/chip-group) · [DescriptionList](/docs/components/description-list) · [EmptyState](/docs/components/empty-state) · [Heading, Text](/docs/components/text) · [List, ListItem](/docs/components/list) · [Progress](/docs/components/progress) · [QRCode](/docs/components/qr-code) · [Stat](/docs/components/stat) · [TextField](/docs/components/text-field) · [ToggleGroup](/docs/components/toggle-group)

And from Patine Pro:

- [AI chat](/docs/blocks/ai-chat) PRO
- [Agenda](/docs/blocks/agenda) PRO
- [App shell and layout](/docs/pro/layout) PRO
- [Brand logos](/docs/components/brand-icons) PRO
- [Combo chart](/docs/components/combo-chart) PRO
- [Pie chart](/docs/components/pie-chart) PRO
- [Timeline](/docs/blocks/timeline) PRO
- [Wizard](/docs/blocks/wizard) PRO

## Files

```text
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`:

```tsx
/** 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
