mirror of https://github.com/fantasticit/think.git
titap: fix unset color
This commit is contained in:
parent
bb1924e89b
commit
0b77a58d86
|
@ -18,7 +18,7 @@ export const BackgroundColor: React.FC<{ editor: Editor }> = ({ editor }) => {
|
||||||
const backgroundColor = useAttributes(
|
const backgroundColor = useAttributes(
|
||||||
editor,
|
editor,
|
||||||
'textStyle',
|
'textStyle',
|
||||||
{ backgroundColor: 'transparent' },
|
{ backgroundColor: null },
|
||||||
(attrs) => attrs.backgroundColor
|
(attrs) => attrs.backgroundColor
|
||||||
);
|
);
|
||||||
const isTitleActive = useActive(editor, Title.name);
|
const isTitleActive = useActive(editor, Title.name);
|
||||||
|
|
|
@ -20,12 +20,7 @@ const FlexStyle = {
|
||||||
export const TextColor: React.FC<{ editor: Editor }> = ({ editor }) => {
|
export const TextColor: React.FC<{ editor: Editor }> = ({ editor }) => {
|
||||||
const isTitleActive = useActive(editor, Title.name);
|
const isTitleActive = useActive(editor, Title.name);
|
||||||
const isTextStyleActive = useActive(editor, TextStyle.name);
|
const isTextStyleActive = useActive(editor, TextStyle.name);
|
||||||
const color = useAttributes<Color, Color['color']>(
|
const color = useAttributes<Color, Color['color']>(editor, 'textStyle', { color: null }, (attrs) => attrs.color);
|
||||||
editor,
|
|
||||||
'textStyle',
|
|
||||||
{ color: 'transparent' },
|
|
||||||
(attrs) => attrs.color
|
|
||||||
);
|
|
||||||
|
|
||||||
const setColor = useCallback(
|
const setColor = useCallback(
|
||||||
(color) => {
|
(color) => {
|
||||||
|
|
Loading…
Reference in New Issue