add emoji removal

This commit is contained in:
Philipinho
2024-01-22 17:36:41 +01:00
parent 29b4c2b9f2
commit e0e5f7c43d
2 changed files with 28 additions and 5 deletions

View File

@ -113,6 +113,11 @@ function Node({ node, style, dragHandle }: NodeRendererProps<any>) {
updatePageMutation.mutateAsync({ id: node.id, icon: emoji.native });
};
const handleRemoveEmoji = () => {
handleUpdateNodeIcon(node.id, null);
updatePageMutation.mutateAsync({ id: node.id, icon: null });
};
if (node.willReceiveDrop && node.isClosed) {
setTimeout(() => {
if (node.state.willReceiveDrop) node.open();
@ -134,7 +139,7 @@ function Node({ node, style, dragHandle }: NodeRendererProps<any>) {
node.data.icon ? node.data.icon :
<IconFileDescription size="18px" />
}/>
} removeEmojiAction={handleRemoveEmoji}/>
</div>
<span className={classes.text}>