MediaAttachmentGrid: fix the vids scale
This commit is contained in:
parent
73a56357d9
commit
41d15887a7
1 changed files with 13 additions and 7 deletions
|
@ -138,6 +138,16 @@ const MediaAttachmentGrid: Component<{
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const style = () => {
|
||||||
|
return Object.assign(
|
||||||
|
{
|
||||||
|
width: `${size().width}px`,
|
||||||
|
height: `${size().height}px`,
|
||||||
|
},
|
||||||
|
accentColor ? { "--media-color-accent": accentColor } : {},
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
switch (item.type) {
|
switch (item.type) {
|
||||||
case "image":
|
case "image":
|
||||||
return (
|
return (
|
||||||
|
@ -148,13 +158,7 @@ const MediaAttachmentGrid: Component<{
|
||||||
alt={item.description || undefined}
|
alt={item.description || undefined}
|
||||||
onClick={[openViewerFor, index()]}
|
onClick={[openViewerFor, index()]}
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
style={Object.assign(
|
style={style()}
|
||||||
{
|
|
||||||
width: `${size().width}px`,
|
|
||||||
height: `${size().height}px`,
|
|
||||||
},
|
|
||||||
accentColor ? { "--media-color-accent": accentColor } : {},
|
|
||||||
)}
|
|
||||||
></img>
|
></img>
|
||||||
);
|
);
|
||||||
case "video":
|
case "video":
|
||||||
|
@ -167,6 +171,7 @@ const MediaAttachmentGrid: Component<{
|
||||||
poster={item.previewUrl}
|
poster={item.previewUrl}
|
||||||
width={width}
|
width={width}
|
||||||
height={height}
|
height={height}
|
||||||
|
style={style()}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
case "gifv":
|
case "gifv":
|
||||||
|
@ -180,6 +185,7 @@ const MediaAttachmentGrid: Component<{
|
||||||
poster={item.previewUrl}
|
poster={item.previewUrl}
|
||||||
width={width}
|
width={width}
|
||||||
height={height}
|
height={height}
|
||||||
|
style={style()}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue