Skip to content

Commit

Permalink
Enable set the icons map
Browse files Browse the repository at this point in the history
  • Loading branch information
mikicho authored Aug 17, 2024
1 parent aceafd5 commit 8ce1c19
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/easy-email-extensions/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ export * from './components/Form';
export * from './components/ShadowDom';

export { getContextMergeTags } from './utils/getContextMergeTags';
export { getIconNameByBlockType } from './utils/getIconNameByBlockType';
export { getIconNameByBlockType, setIconsMap } from './utils/getIconNameByBlockType';
export { getBlockTitle } from './utils/getBlockTitle';
export { MjmlToJson } from './utils/MjmlToJson';
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BasicType, AdvancedType } from 'easy-email-core';
import { get } from 'lodash';

const iconsMap = {
let iconsMap = {
[BasicType.TEXT]: 'icon-text',
[BasicType.SECTION]: 'icon-section',
[BasicType.COLUMN]: 'icon-column',
Expand Down Expand Up @@ -38,3 +38,7 @@ const iconsMap = {
export function getIconNameByBlockType(type: string) {
return get(iconsMap, type) || 'icon-number';
}

export function setIconsMap(map: Record<string, string>) {
iconsMap = {...map};
}

0 comments on commit 8ce1c19

Please sign in to comment.