[LWDM] feat: lwd add icon image key value for braze action cards#15584
[LWDM] feat: lwd add icon image key value for braze action cards#15584RobinVncnt merged 1 commit intodevelopfrom
Conversation
Web Tools Build Status
|
|
There was a problem hiding this comment.
Pull request overview
Adds support for two additional Braze action card extras (icon and image_background) across mobile + desktop dynamic content, and wires them through the local Braze dev tools and UI components so the action card variant can change based on these keys.
Changes:
- Mobile: extend
HorizontalContentCardmapping/types to includeimage_background, and update the action banner card to branch on it. - Desktop: extend
ActionContentCardtype + Braze mapping, pass new props through the dashboard action cards, and allow generating these fields via the BrazeTools modal. - Desktop MVVM: extend
ContentBannerActionCardto accepticonandimage_background.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/ledger-live-mobile/src/dynamicContent/utils.tsx | Maps Braze image_background into horizontal action cards. |
| apps/ledger-live-mobile/src/dynamicContent/types.ts | Extends HorizontalContentCard with image_background. |
| apps/ledger-live-mobile/src/contentCards/cards/contentBannerAction/index.tsx | Switches banner variant selection to use image_background and supports icon. |
| apps/ledger-live-desktop/src/types/dynamicContent.ts | Extends ActionContentCard with image_background and icon. |
| apps/ledger-live-desktop/src/renderer/hooks/useBraze.ts | Maps Braze icon / image_background extras into ActionContentCard. |
| apps/ledger-live-desktop/src/renderer/screens/dashboard/ActionContentCards.tsx | Passes icon / image_background down to the banner card component. |
| apps/ledger-live-desktop/src/renderer/screens/settings/sections/Developer/BrazeTools/Modal/Body.tsx | Adds form fields for image_background and icon when generating local Action cards. |
| apps/ledger-live-desktop/src/renderer/screens/settings/sections/Developer/BrazeTools/Hooks/useGenerateLocalBraze.ts | Updates local action-card generation to include optional icon and image_background. |
| apps/ledger-live-desktop/src/mvvm/features/DynamicContent/components/ContentBannerActionCard/index.tsx | Accepts icon / image_background props and selects an icon by name. |
| .changeset/silent-rice-shop.md | Declares minor bumps for desktop and mobile to reflect the feature addition. |
Comments suppressed due to low confidence (1)
apps/ledger-live-mobile/src/contentCards/cards/contentBannerAction/index.tsx:44
imageBackground/props.image_backgroundis only used to switch rendering branches, but the URL is never actually applied to theContentBanner(or any wrapper). As-is, providingimage_backgroundwon’t display an image background, it will only remove theSpoticon.
const imageBackground =
"image_background" in props && props.image_background?.length
? props.image_background
: undefined;
const iconProp =
"icon" in props && props.icon !== undefined ? (props.icon as keyof typeof Icons) : "Settings";
const icon = Icons[iconProp] || Icons.Settings;
useEffect(() => metadata.actions?.onView?.());
const handleDismiss = useCallback(
(event?: GestureResponderEvent) => {
if (event) {
event.preventDefault();
event.stopPropagation();
}
metadata.actions?.onDismiss?.();
},
[metadata.actions],
);
if (imageBackground && imageBackground.length > 0) {
return (
<Pressable onPress={metadata.actions?.onClick} key={metadata.id}>
<ContentBanner onClose={handleDismiss}>
<ContentBannerContent>
You can also share your feedback on Copilot code review. Take the survey.
|




✅ Checklist
npx changesetwas attached.📝 Description
❓ Context
🧐 Checklist for the PR Reviewers