Skip to content

Commit

Permalink
Fix reply username overflow (#1501)
Browse files Browse the repository at this point in the history
* fix reply overflow

* fix shrinkable typing indicator

* fix message avatar hover & cursor
  • Loading branch information
ajbura authored Oct 24, 2023
1 parent 8731f58 commit c7e5c1f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/app/components/message/Reply.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ export const Reply = as<'div', ReplyProps>(
{...props}
ref={ref}
>
<Box style={{ color: colorMXID(sender ?? eventId) }} alignItems="Center" shrink="No">
<Box
style={{ color: colorMXID(sender ?? eventId), maxWidth: '50%' }}
alignItems="Center"
shrink="No"
>
<Icon src={Icons.ReplyArrow} size="50" />
{sender && (
<Text size="T300" truncate>
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/message/layout/layout.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ export const CompactHeader = style([

export const AvatarBase = style({
paddingTop: toRem(4),
cursor: 'pointer',
transition: 'transform 200ms cubic-bezier(0, 0.8, 0.67, 0.97)',
alignSelf: 'start',

selectors: {
'&:hover': {
Expand Down
1 change: 1 addition & 0 deletions src/app/components/typing-indicator/TypingIndicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const TypingIndicator = as<'div', TypingIndicatorProps>(({ size, style, .
<Box
as="span"
alignItems="Center"
shrink="No"
style={{ gap: toRem(size === '300' ? 1 : 2), ...style }}
{...props}
ref={ref}
Expand Down
8 changes: 7 additions & 1 deletion src/app/organisms/room/message/Message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,13 @@ export const Message = as<'div', MessageProps>(

const avatarJSX = !collapse && messageLayout !== 1 && (
<AvatarBase>
<Avatar as="button" size="300" data-user-id={senderId} onClick={onUserClick}>
<Avatar
className={css.MessageAvatar}
as="button"
size="300"
data-user-id={senderId}
onClick={onUserClick}
>
{senderAvatarMxc ? (
<AvatarImage
src={mx.mxcUrlToHttp(senderAvatarMxc, 48, 48, 'crop') ?? senderAvatarMxc}
Expand Down
4 changes: 4 additions & 0 deletions src/app/organisms/room/message/styles.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ export const MessageOptionsBar = style([
},
]);

export const MessageAvatar = style({
cursor: 'pointer',
});

export const MessageQuickReaction = style({
minWidth: toRem(32),
});
Expand Down

0 comments on commit c7e5c1f

Please sign in to comment.