Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Message content width #16533

Merged
merged 3 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,14 @@ const ContentAsset = ({
}
case AssetType.IMAGE:
return (
<ImageAsset
asset={asset as MediumImage}
message={message}
onClick={onClickImage}
isFocusable={isMessageFocused}
/>
<div key={asset.id} className="message-asset">
<ImageAsset
asset={asset as MediumImage}
message={message}
onClick={onClickImage}
isFocusable={isMessageFocused}
/>
</div>
);
case AssetType.LOCATION:
return <LocationAsset asset={asset as Location} />;
Expand Down
3 changes: 2 additions & 1 deletion src/style/common/variables.less
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,14 @@ body {
// ----------------------------------------------------------------------------
// Conversation
// ----------------------------------------------------------------------------
@conversation-max-width: 800px;
@conversation-max-width: 100%;

@conversation-message-max-width: 640px;
@conversation-message-sender-width: 64px;

body {
--conversation-message-sender-width: @conversation-message-sender-width;
--conversation-message-asset-width: 800px;

--conversation-message-timestamp-width: 140px;
@media (max-width: @screen-md-min) {
Expand Down
7 changes: 3 additions & 4 deletions src/style/content/conversation/message-list.less
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,8 @@
padding-left: @conversation-message-sender-width;

&-content {
width: calc(100% - var(--conversation-message-timestamp-width));
max-width: calc(
@conversation-max-width - @conversation-message-sender-width - var(--conversation-message-timestamp-width)
);
width: 100%;
max-width: calc(@conversation-max-width - var(--conversation-message-sender-width));
}

.text {
Expand Down Expand Up @@ -790,6 +788,7 @@

// MESSAGE SPACING
.message-asset {
max-width: var(--conversation-message-asset-width);
flex: 1;
margin-top: 8px;
}
Expand Down
Loading