style: show entire image preview in room timeline

This commit is contained in:
sup39 2023-11-23 13:38:27 +09:00
parent 9ecb233763
commit 77ab3fba1e
Signed by: sup39
GPG key ID: 111C00916C1641E5
3 changed files with 5 additions and 5 deletions

View file

@ -9,7 +9,7 @@ export const Attachment = recipe({
borderRadius: config.radii.R400, borderRadius: config.radii.R400,
overflow: 'hidden', overflow: 'hidden',
maxWidth: '100%', maxWidth: '100%',
width: toRem(400), // width: toRem(400),
}, },
variants: { variants: {
outlined: { outlined: {
@ -31,7 +31,7 @@ export const AttachmentBox = style([
{ {
maxWidth: '100%', maxWidth: '100%',
maxHeight: toRem(600), maxHeight: toRem(600),
width: toRem(400), // width: toRem(400),
overflow: 'hidden', overflow: 'hidden',
}, },
]); ]);

View file

@ -1100,13 +1100,13 @@ export function RoomTimeline({ room, eventId, roomInputRef, editor }: RoomTimeli
if (typeof mxcUrl !== 'string') { if (typeof mxcUrl !== 'string') {
return null; return null;
} }
const height = scaleYDimension(imgInfo?.w || 400, 400, imgInfo?.h || 400); // const height = scaleYDimension(imgInfo?.w || 400, 400, imgInfo?.h || 400);
return ( return (
<Attachment> <Attachment>
<AttachmentBox <AttachmentBox
style={{ style={{
height: toRem(height < 48 ? 48 : height), // height: toRem(height < 48 ? 48 : height),
}} }}
> >
<ImageContent <ImageContent

View file

@ -121,7 +121,7 @@ export const ImageContent = as<'div', ImageContentProps>(
</Box> </Box>
)} )}
{srcState.status === AsyncStatus.Success && ( {srcState.status === AsyncStatus.Success && (
<Box className={css.AbsoluteContainer}> <Box className={css.AbsoluteContainer} style={{position: 'unset'}}>
<Image <Image
alt={body} alt={body}
title={body} title={body}