refactor: image preview modal

This commit is contained in:
zerosoul
2022-04-02 16:24:33 +08:00
parent 438121fa0f
commit c4953a0838
4 changed files with 43 additions and 13 deletions
@@ -50,11 +50,13 @@ const renderContent = ({
case "image/png":
case "image/jpeg":
{
const { name, size, type } = properties;
const { width, height } = getDefaultSize(properties);
ctn = (
<img
className="img preview"
style={{ width: `${width}px`, height: `${height}px` }}
data-meta={JSON.stringify({ width, height, name, type, size })}
data-origin={content}
src={thumbnail || content}
/>