Skip to content

Commit

Permalink
Merge pull request #4081 from regmsif/fix/image-edit-link
Browse files Browse the repository at this point in the history
fix: image edit link button not pressable
  • Loading branch information
zbeyens authored Feb 14, 2025
2 parents 639e4bf + 6704e53 commit 6865d85
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/blue-taxis-push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@udecode/plate-media': patch
---

fix: image edit link button not pressable
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,17 @@ import { createPrimitiveComponent, useElement } from '@udecode/plate/react';

import type { TMediaElement } from '../../../lib/media/types';

import { ImagePreviewStore } from '../../image';
import { FloatingMediaStore } from './FloatingMediaStore';

export const useFloatingMediaEditButton = () => {
const element = useElement<TMediaElement>();

return {
props: {
onClick: React.useCallback(() => {
ImagePreviewStore.set('currentPreview', {
id: element.id,
url: element.url,
});
ImagePreviewStore.set('isEditingScale', true);
}, [element.id, element.url]),
FloatingMediaStore.set('url', element.url);
FloatingMediaStore.set('isEditing', true);
}, [element.url]),
},
};
};
Expand Down

0 comments on commit 6865d85

Please sign in to comment.