mirror of
https://github.com/strapi/strapi.git
synced 2025-11-10 07:10:11 +00:00
fix: show media dialog in blocks and markdown editors (#20846)
* fix: show media dialow in blocks and markdown editors * fix: creating folders * chore: remove unnecessary onClose code
This commit is contained in:
parent
a04615767f
commit
d938b73b42
@ -196,9 +196,11 @@ const imageBlocks: Pick<BlocksStore, 'image'> = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleConvert: () => {
|
handleConvert: () => {
|
||||||
// All the logic is managed inside the ImageDialog component,
|
/**
|
||||||
// because the blocks are only created when the user selects images in the modal and submits
|
* All the logic is managed inside the ImageDialog component,
|
||||||
// and if he closes the modal, then no changes are made to the editor
|
* because the blocks are only created when the user selects images in the modal and submits
|
||||||
|
* and if he closes the modal, then no changes are made to the editor
|
||||||
|
*/
|
||||||
return () => <ImageDialog />;
|
return () => <ImageDialog />;
|
||||||
},
|
},
|
||||||
snippets: ['!['],
|
snippets: ['!['],
|
||||||
|
|||||||
@ -22,11 +22,8 @@ export const MediaLibraryDialog = ({ onClose, onSelectAssets, allowedTypes }) =>
|
|||||||
<AssetDialog
|
<AssetDialog
|
||||||
allowedTypes={allowedTypes}
|
allowedTypes={allowedTypes}
|
||||||
folderId={folderId}
|
folderId={folderId}
|
||||||
onClose={() => {
|
open
|
||||||
setStep(undefined);
|
onClose={onClose}
|
||||||
setFolderId(null);
|
|
||||||
onClose();
|
|
||||||
}}
|
|
||||||
onValidate={onSelectAssets}
|
onValidate={onSelectAssets}
|
||||||
onAddAsset={() => setStep(STEPS.AssetUpload)}
|
onAddAsset={() => setStep(STEPS.AssetUpload)}
|
||||||
onAddFolder={() => setStep(STEPS.FolderCreate)}
|
onAddFolder={() => setStep(STEPS.FolderCreate)}
|
||||||
@ -37,11 +34,17 @@ export const MediaLibraryDialog = ({ onClose, onSelectAssets, allowedTypes }) =>
|
|||||||
|
|
||||||
case STEPS.FolderCreate:
|
case STEPS.FolderCreate:
|
||||||
return (
|
return (
|
||||||
<EditFolderDialog onClose={() => setStep(STEPS.AssetSelect)} parentFolderId={folderId} />
|
<EditFolderDialog
|
||||||
|
open
|
||||||
|
onClose={() => setStep(STEPS.AssetSelect)}
|
||||||
|
parentFolderId={folderId}
|
||||||
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return <UploadAssetDialog onClose={() => setStep(STEPS.AssetSelect)} folderId={folderId} />;
|
return (
|
||||||
|
<UploadAssetDialog open onClose={() => setStep(STEPS.AssetSelect)} folderId={folderId} />
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user