From dc6ede4d8056776bae5cfb9d1529213949312e3b Mon Sep 17 00:00:00 2001 From: Jillian Date: Fri, 4 Oct 2024 07:56:12 +0930 Subject: [PATCH] fix: use "other" component type in decide Card header background (#1359) if no other background color is found --- src/generic/block-type-utils/constants.ts | 1 + src/generic/block-type-utils/index.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/generic/block-type-utils/constants.ts b/src/generic/block-type-utils/constants.ts index 792ab33ac..ab91ee25d 100644 --- a/src/generic/block-type-utils/constants.ts +++ b/src/generic/block-type-utils/constants.ts @@ -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', }; diff --git a/src/generic/block-type-utils/index.tsx b/src/generic/block-type-utils/index.tsx index 0204b8e01..e88f69cb4 100644 --- a/src/generic/block-type-utils/index.tsx +++ b/src/generic/block-type-utils/index.tsx @@ -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; }