Skip to content

Commit

Permalink
Merge pull request #33 from cesarParra/example-image-reference-fix
Browse files Browse the repository at this point in the history
chore: kitchen sink demo images
  • Loading branch information
cesarParra authored Dec 11, 2024
2 parents 917f8ab + 2f3cab3 commit b0f38c8
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 3 deletions.
5 changes: 5 additions & 0 deletions examples/main/default/staticresources/tee.resource-meta.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<StaticResource xmlns="http://soap.sforce.com/2006/04/metadata">
<cacheControl>Public</cacheControl>
<contentType>image/webp</contentType>
</StaticResource>
Binary file added examples/main/default/staticresources/tee.webp
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<StaticResource xmlns="http://soap.sforce.com/2006/04/metadata">
<cacheControl>Public</cacheControl>
<contentType>image/webp</contentType>
</StaticResource>
Binary file not shown.
4 changes: 2 additions & 2 deletions examples/shopping-cart/controllers/ShoppingCartController.cls
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public with sharing class ShoppingCartController {

private static List<ItemDto> buildSampleItemList() {
List<ItemDto> items = new List<ItemDto>();
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'));
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'));
items.add(new ItemDto('1', 'Nomad Tumbler', new List<String>{'White'}, 1, 35.0, 'resource/tumbler'));
items.add(new ItemDto('2', 'Basic Tee', new List<String>{'Sienna', 'Large'}, 1, 32.0, 'resource/tee'));
return items;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
cartHistory,
undoCartChange
} from "c/demoSignals";
import basePath from "@salesforce/community/basePath";

// States
import ready from "./states/ready.html";
Expand Down Expand Up @@ -43,7 +44,11 @@ export default class ShoppingCartDetails extends TwElement {
get items() {
return (
this.itemData.data.items?.map((item) => {
return { ...item, total: item.price * item.quantity };
return {
...item,
imgUrl: `${basePath}/${item.imgUrl}`,
total: item.price * item.quantity
};
}) ?? []
);
}
Expand Down

0 comments on commit b0f38c8

Please sign in to comment.