Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .changeset/storefront-custom-samples.md

This file was deleted.

8 changes: 8 additions & 0 deletions packages/commerce-storefront/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @godaddy/gd-commerce-storefront

## 0.11.0

### Minor Changes

- 53bbe3b: A site can show its own sample products before a store is connected. `sampleProducts` on `Catalog` and `CatalogRoot` takes an array as well as `true`. Each sample has a `key`, `name` and `price`, and optionally a `compareAtPrice`, `description` and `imageUrl`, such as a file in the site's public folder. The card parts show a sample's image, description, price and Sale badge, and the sample cart keeps each line's image. While no store is connected, `CatalogRoot` throws for an invalid list, such as duplicate keys, a packaged sample's key or a decimal price; once one is connected, development builds log the problem instead and the store's catalog still renders. A cart line shows the current fields of a mounted catalog's sample with the same key. `CartItemImage` renders nothing when its image fails to load. `sampleProducts` still shows samples only while the server reports `unbound`, and `true` still shows the six packaged samples without images.

Custom parts can read the site's own sample fields. `useProductCard()` and `useCartItem()` return `sample`, typed with the site's sample type, such as `useProductCard<MySample>()`. A new `useCatalog()` returns the catalog's `count`, `isSample` and `status` for a custom product count. Card images and their loading placeholders follow a new `--commerce-card-image-aspect` theme property, which defaults to square. The `SampleProduct` and `CatalogState` types are exported. The default design is unchanged.

## 0.10.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/commerce-storefront/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@godaddy/gd-commerce-storefront",
"version": "0.10.0",
"version": "0.11.0",
"description": "Opinionated React storefront templates for GoDaddy Commerce",
"type": "module",
"license": "MIT",
Expand Down
Loading