From c2df7dd74fa4af04248082d9fcda92197db1bab4 Mon Sep 17 00:00:00 2001 From: Felipe Mota Date: Wed, 30 Oct 2024 22:05:05 -0300 Subject: [PATCH] fix(insert-panel): Show alias preview image for default components Issue: https://linear.app/plasmic/issue/PLA-11354 GitOrigin-RevId: 5d2502b530a0ddaa98abc16e63680bb77c17e430 --- .../client/components/insert-panel/InsertPanel.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/platform/wab/src/wab/client/components/insert-panel/InsertPanel.tsx b/platform/wab/src/wab/client/components/insert-panel/InsertPanel.tsx index 894fd100418..f25c339625f 100644 --- a/platform/wab/src/wab/client/components/insert-panel/InsertPanel.tsx +++ b/platform/wab/src/wab/client/components/insert-panel/InsertPanel.tsx @@ -1080,6 +1080,7 @@ export function buildAddItemGroups({ return undefined; } const resolved = insertPanelAliases.get(alias as any); + const aliasImageUrl = `https://plasmic-static1.s3.us-west-2.amazonaws.com/insertables/${alias}.svg`; // Is this a built-in insertable? if (!resolved) { @@ -1101,7 +1102,7 @@ export function buildAddItemGroups({ } return { ...createAddTplComponent(component), - previewImageUrl: `https://plasmic-static1.s3.us-west-2.amazonaws.com/insertables/${alias}.svg`, + previewImageUrl: aliasImageUrl, isCompact: true, }; } @@ -1134,10 +1135,13 @@ export function buildAddItemGroups({ // The template name needs to be of format "/". E.g. For Plexus button, it will be "plexus/button". // The template name will be fetched from devflags.insertableTemplates. - return handleTemplateAlias( - `${PLEXUS_INSERTABLE_ID}/${kind}`, - kind - ); + return { + previewImageUrl: aliasImageUrl, + ...handleTemplateAlias( + `${PLEXUS_INSERTABLE_ID}/${kind}`, + kind + ), + }; } else { return undefined; }