Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Style Book: Fix Featured Product and Featured Category Blocks preview #8313

Merged
merged 8 commits into from
Jan 27, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"default": 500
},
"linkText": {
"default": "Shop now",
"type": "string"
},
"categoryId": {
Expand Down
2 changes: 2 additions & 0 deletions assets/js/blocks/featured-items/featured-category/example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ type ExampleBlock = Block[ 'example' ] & {
attributes: {
categoryId: 'preview' | number;
previewCategory: typeof previewCategories[ number ];
editMode: false;
};
};

export const example: ExampleBlock = {
attributes: {
categoryId: 'preview',
previewCategory: previewCategories[ 0 ],
editMode: false,
},
} as const;
2 changes: 2 additions & 0 deletions assets/js/blocks/featured-items/featured-product/example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ type ExampleBlock = Block[ 'example' ] & {
attributes: {
productId: 'preview' | number;
previewProduct: typeof previewProducts[ number ];
editMode: false;
};
};

export const example: ExampleBlock = {
attributes: {
productId: 'preview',
previewProduct: previewProducts[ 0 ],
editMode: false,
},
} as const;
2 changes: 1 addition & 1 deletion assets/js/blocks/featured-items/register.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export function register(
...DEFAULT_SETTINGS,
example: {
...DEFAULT_EXAMPLE,
example,
...example,
},
/**
* Renders and manages the block.
Expand Down