Skip to content

Commit

Permalink
fix(insert-panel): Show alias preview image for default components
Browse files Browse the repository at this point in the history
Issue: https://linear.app/plasmic/issue/PLA-11354
GitOrigin-RevId: 5d2502b530a0ddaa98abc16e63680bb77c17e430
  • Loading branch information
FMota0 authored and actions-user committed Nov 13, 2024
1 parent 8de47f3 commit c2df7dd
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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,
};
}
Expand Down Expand Up @@ -1134,10 +1135,13 @@ export function buildAddItemGroups({

// The template name needs to be of format "<PLEXUS_INSERTABLE_ID>/<kind>". 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;
}
Expand Down

0 comments on commit c2df7dd

Please sign in to comment.