Skip to content

Commit d3e6ee7

Browse files
authored
fix: correctly render nested quotes media attachments in quotes (#1075)
* fix: correctly render nested media attachments in quotes * chore: fix formatting in TextAttachment
1 parent 37896cb commit d3e6ee7

2 files changed

Lines changed: 238 additions & 133 deletions

File tree

packages/react/src/views/AttachmentHandler/AttachmentMetadata.js

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,15 @@ const AttachmentMetadata = ({
4141
} else if (attachment?.size) {
4242
sizeInBytes = attachment.size;
4343
} else {
44-
sizeInBytes = 0;
44+
return null;
4545
}
4646

4747
const sizeInKB = (sizeInBytes / 1024).toFixed(2);
4848
return `${sizeInKB} kB`;
4949
};
5050

51+
const fileSize = getFormattedFileSize();
52+
5153
return (
5254
<Box
5355
css={[
@@ -116,17 +118,19 @@ const AttachmentMetadata = ({
116118
: attachment?.title}
117119
</p>
118120
</Tooltip>
119-
<Box
120-
css={css`
121-
font-size: 12px;
122-
opacity: 0.7;
123-
@media (max-width: 420px) {
124-
margin-left: 0;
125-
}
126-
`}
127-
>
128-
({getFormattedFileSize()})
129-
</Box>
121+
{fileSize && (
122+
<Box
123+
css={css`
124+
font-size: 12px;
125+
opacity: 0.7;
126+
@media (max-width: 420px) {
127+
margin-left: 0;
128+
}
129+
`}
130+
>
131+
({fileSize})
132+
</Box>
133+
)}
130134
</Box>
131135

132136
<Box

0 commit comments

Comments
 (0)