fix: use "other" component type in decide Card header background (#1359)

if no other background color is found
This commit is contained in:
Jillian
2024-10-04 07:56:12 +09:30
committed by GitHub
parent 8c6bbb895f
commit dc6ede4d80
2 changed files with 2 additions and 1 deletions

View File

@@ -67,4 +67,5 @@ export const COMPONENT_TYPE_STYLE_COLOR_MAP = {
sequential: 'component-style-default',
chapter: 'component-style-default',
collection: 'component-style-collection',
other: 'component-style-other',
};

View File

@@ -11,5 +11,5 @@ export function getItemIcon(blockType: string): React.ComponentType {
}
export function getComponentStyleColor(blockType: string): string {
return COMPONENT_TYPE_STYLE_COLOR_MAP[blockType] ?? 'bg-component';
return COMPONENT_TYPE_STYLE_COLOR_MAP[blockType] ?? COMPONENT_TYPE_STYLE_COLOR_MAP.other;
}