Skip to content

Commit b0f38c8

Browse files
authored
Merge pull request #33 from cesarParra/example-image-reference-fix
chore: kitchen sink demo images
2 parents 917f8ab + 2f3cab3 commit b0f38c8

File tree

6 files changed

+18
-3
lines changed

6 files changed

+18
-3
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<StaticResource xmlns="http://soap.sforce.com/2006/04/metadata">
3+
<cacheControl>Public</cacheControl>
4+
<contentType>image/webp</contentType>
5+
</StaticResource>
37.5 KB
Loading
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<StaticResource xmlns="http://soap.sforce.com/2006/04/metadata">
3+
<cacheControl>Public</cacheControl>
4+
<contentType>image/webp</contentType>
5+
</StaticResource>
59.6 KB
Loading

examples/shopping-cart/controllers/ShoppingCartController.cls

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ public with sharing class ShoppingCartController {
1212

1313
private static List<ItemDto> buildSampleItemList() {
1414
List<ItemDto> items = new List<ItemDto>();
15-
items.add(new ItemDto('1', 'Nomad Tumbler', new List<String>{'White'}, 1, 35.0, 'https://tailwindui.com/img/ecommerce-images/shopping-cart-page-01-product-03.jpg'));
16-
items.add(new ItemDto('2', 'Basic Tee', new List<String>{'Sienna', 'Large'}, 1, 32.0, 'https://tailwindui.com/img/ecommerce-images/shopping-cart-page-01-product-01.jpg'));
15+
items.add(new ItemDto('1', 'Nomad Tumbler', new List<String>{'White'}, 1, 35.0, 'resource/tumbler'));
16+
items.add(new ItemDto('2', 'Basic Tee', new List<String>{'Sienna', 'Large'}, 1, 32.0, 'resource/tee'));
1717
return items;
1818
}
1919

examples/shopping-cart/lwc/shoppingCartDetails/shoppingCartDetails.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
cartHistory,
77
undoCartChange
88
} from "c/demoSignals";
9+
import basePath from "@salesforce/community/basePath";
910

1011
// States
1112
import ready from "./states/ready.html";
@@ -43,7 +44,11 @@ export default class ShoppingCartDetails extends TwElement {
4344
get items() {
4445
return (
4546
this.itemData.data.items?.map((item) => {
46-
return { ...item, total: item.price * item.quantity };
47+
return {
48+
...item,
49+
imgUrl: `${basePath}/${item.imgUrl}`,
50+
total: item.price * item.quantity
51+
};
4752
}) ?? []
4853
);
4954
}

0 commit comments

Comments
 (0)