fix(editor): should keep color on custom color button (#11773)

Closes: [BS-3167](https://linear.app/affine-design/issue/BS-3167/自定义按钮显示错误)
This commit is contained in:
fundon
2025-04-17 12:21:39 +00:00
parent 8dc21e53ca
commit a46bb446e2
5 changed files with 129 additions and 7 deletions

View File

@@ -241,6 +241,7 @@ const ImportOptionItem = ({
suffixTooltip,
type,
onImport,
...props
}: {
label: string;
prefixIcon: ReactElement<SVGAttributes<SVGElement>>;
@@ -251,7 +252,7 @@ const ImportOptionItem = ({
}) => {
const t = useI18n();
return (
<div className={style.importItem} onClick={() => onImport(type)}>
<div className={style.importItem} onClick={() => onImport(type)} {...props}>
{prefixIcon}
<div className={style.importItemLabel}>{t[label]()}</div>
{suffixIcon && (
@@ -292,9 +293,9 @@ const ImportOptions = ({
suffixIcon={suffixIcon}
suffixTooltip={suffixTooltip}
label={label}
data-testid={testId}
type={type}
onImport={onImport}
data-testid={testId}
/>
)
)}