Skip to content

Commit 75adfd5

Browse files
committed
💄(frontend) set yellow background color to callout block
Set the default background color to yellow on the callout block.
1 parent 93f5134 commit 75adfd5

File tree

1 file changed

+10
-0
lines changed
  • src/frontend/apps/impress/src/features/docs/doc-editor/components/custom-blocks

1 file changed

+10
-0
lines changed

src/frontend/apps/impress/src/features/docs/doc-editor/components/custom-blocks/CalloutBlock.tsx

+10
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,16 @@ const CalloutBlockElement = ({
113113
handleEmojiSelect,
114114
} = useCalloutBlock();
115115

116+
// Temporary: sets a yellow background color to a callout block when added by
117+
// the user, while keeping the colors menu on the drag handler usable for
118+
// this custom block.
119+
useEffect(() => {
120+
if (!block.content.length && block.props.backgroundColor === 'default') {
121+
console.log('in if statement');
122+
editor.updateBlock(block, { props: { backgroundColor: 'yellow' } });
123+
}
124+
}, []);
125+
116126
return (
117127
<Box
118128
$padding="1rem"

0 commit comments

Comments
 (0)