Skip to main content

Boutique store: Ouro Pro

Ouro sells handmade home goods. Product pictures are drawn in the swatch you pick, so the demo needs no photos; swap in your images through ProductCard's renderImage. Try the promo code SLOW10 in the bag.

See it live, on any device

Use the whole app​

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

<StoreApp />;
PropTypeDefault
initialRoute'discover' | 'shop' | 'product' | 'bag' | 'checkout' | 'order' | 'saved' | 'account''discover'
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
DiscoverScreenCollections in an autoplaying Carousel, categories, new arrivals and bestsellers on Pro's ProductCard
ShopScreenSearchField, category chips, a sort Select and a grid that grows to four columns
ProductScreenA Pager gallery with dots, swatches, a quantity stepper, Add to bag that becomes View bag, an Accordion of details, ReviewList, pairings
BagScreenFree-delivery progress, SwipeableRow to save or remove, a promo code, totals, Checkout pinned
StoreCheckoutScreenPro's Wizard: address with validation, delivery RadioGroup, payment with brand logos, review
OrderScreenPro's OrderTracker with courier scans, the items, help
SavedScreenThe wishlist with Add to bag on the card and an empty state
StoreAccountScreenA members card with points, orders with status badges, settings

Every screen is exported on its own, takes its data as props, and has sample data as defaults. bagTotals(lines, products, discount, delivery) works out items, promo, delivery (free past €75) and how far from free delivery; filterProducts searches, filters and sorts.

Built with​

The free components, from patine-ui:

Accordion · Avatar · Badge · Button · Carousel, PageIndicator, Pager · ChipGroup · DescriptionList · Heading, Text · List, ListItem · Progress · RadioGroup, RadioGroupItem · Rating · SearchField · Select · Separator · SwipeableRow · TextField

And from Patine Pro:

Files​

store/
├── components/
│ └── StoreProductCard.tsx
├── hooks/
│ ├── useStoreApp.ts
│ └── useStoreScreens.ts
├── BagScreen.tsx
├── BrowseScreen.tsx
├── DiscoverScreen.tsx
├── index.ts
├── OrderScreen.tsx
├── ProductScreen.tsx
├── SavedScreen.tsx
├── store.constants.ts
├── store.types.ts
├── store.utils.ts
├── StoreAccountScreen.tsx
├── StoreApp.tsx
└── StoreCheckoutScreen.tsx

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

A look at the code​

The bag’s totals, promo and free-delivery threshold, from store.utils.ts:

/**
* What the bag comes to: the items, a promo off them, delivery (free past the threshold for standard), and how far from free
* shipping it still is.
*/
export const bagTotals = (lines: readonly BagLine[], products: readonly Product[], discount = 0, delivery: number = SHIPPING_FEE) => {
const subtotal = lines.reduce((sum, l) => sum + (productById(products, l.productId)?.price ?? 0) * l.quantity, 0);
const off = Math.round(subtotal * discount);
const shipping = subtotal === 0 || (delivery === SHIPPING_FEE && subtotal - off >= FREE_SHIPPING) ? 0 : delivery;
return {
count: lines.reduce((n, l) => n + l.quantity, 0),
subtotal,
discount: off,
shipping,
total: subtotal - off + shipping,
toFreeShipping: Math.max(0, FREE_SHIPPING - (subtotal - off)),
};
};
Get the source with Pro