feat: preview library block changes in course unit [FC-0062] (#1506)

Creates a new preview library block modal. Intercepts the message when the block is iframed to open the new modal.
This commit is contained in:
Navin Karkera
2024-11-23 01:48:43 +05:30
committed by GitHub
parent 31f59d6bca
commit 7aa5accdbb
17 changed files with 458 additions and 69 deletions

View File

@@ -285,10 +285,11 @@ export const useLibraryPasteClipboard = () => {
});
};
export const useLibraryBlockMetadata = (usageId: string) => (
export const useLibraryBlockMetadata = (usageId: string | undefined) => (
useQuery({
queryKey: xblockQueryKeys.componentMetadata(usageId),
queryFn: () => getLibraryBlockMetadata(usageId),
queryKey: xblockQueryKeys.componentMetadata(usageId!),
queryFn: () => getLibraryBlockMetadata(usageId!),
enabled: !!usageId,
})
);