Skip to content

Commit ff785f3

Browse files
authoredJul 9, 2021
feat(form-builder): allow custom icon for built-in decorators (#2272)
1 parent d14ccd0 commit ff785f3

File tree

1 file changed

+5
-1
lines changed
  • packages/@sanity/form-builder/src/inputs/PortableText/Toolbar

1 file changed

+5
-1
lines changed
 

‎packages/@sanity/form-builder/src/inputs/PortableText/Toolbar/helpers.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ function getFormatIcon(
2727
type: string,
2828
schemaIcon?: React.ComponentType | string
2929
): React.ComponentType {
30+
if (schemaIcon) {
31+
return schemaIcon as React.ComponentType
32+
}
33+
3034
switch (type) {
3135
case 'strong':
3236
return FormatBoldIcon
@@ -39,7 +43,7 @@ function getFormatIcon(
3943
case 'code':
4044
return FormatCodeIcon
4145
default:
42-
return schemaIcon || SanityLogoIcon
46+
return SanityLogoIcon
4347
}
4448
}
4549

0 commit comments

Comments
 (0)