Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
feat: implement new read receipt design
Browse files Browse the repository at this point in the history
  • Loading branch information
justjanne committed Apr 21, 2022
1 parent afac1a4 commit 7acae00
Show file tree
Hide file tree
Showing 7 changed files with 327 additions and 130 deletions.
1 change: 1 addition & 0 deletions res/css/_components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@
@import "./views/rooms/_NotificationBadge.scss";
@import "./views/rooms/_PinnedEventTile.scss";
@import "./views/rooms/_PresenceLabel.scss";
@import "./views/rooms/_ReadReceiptGroup.scss";
@import "./views/rooms/_RecentlyViewedButton.scss";
@import "./views/rooms/_ReplyPreview.scss";
@import "./views/rooms/_ReplyTile.scss";
Expand Down
31 changes: 0 additions & 31 deletions res/css/views/rooms/_EventTile.scss
Original file line number Diff line number Diff line change
Expand Up @@ -355,37 +355,6 @@ $left-gutter: 64px;
}
}

.mx_EventTile_readAvatars {
position: relative;
display: inline-block;
width: 14px;
height: 14px;
// This aligns the avatar with the last line of the
// message. We want to move it one line up
// See .mx_GroupLayout .mx_EventTile .mx_EventTile_line in _GroupLayout.scss
top: -$font-22px;
user-select: none;
z-index: 1;
}

.mx_EventTile_readAvatars .mx_BaseAvatar {
position: absolute;
display: inline-block;
height: $font-14px;
width: $font-14px;

will-change: left, top;
transition:
left var(--transition-short) ease-out,
top var(--transition-standard) ease-out;
}

.mx_EventTile_readAvatarRemainder {
color: $event-timestamp-color;
font-size: $font-11px;
position: absolute;
}

.mx_EventTile_bigEmoji {
font-size: 48px;
line-height: 57px;
Expand Down
126 changes: 126 additions & 0 deletions res/css/views/rooms/_ReadReceiptGroup.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
.mx_ReadReceiptGroup {
position: relative;
display: inline-block;
// This aligns the avatar with the last line of the
// message. We want to move it one line up
// See .mx_GroupLayout .mx_EventTile .mx_EventTile_line in _GroupLayout.scss
top: calc(-$font-22px - 3px);
user-select: none;
z-index: 1;

.mx_ReadReceiptGroup_button {
display: inline-flex;
flex-direction: row;
height: 16px;
padding: 4px;
border-radius: 6px;

&.mx_AccessibleButton {
&:hover {
background: #F4F6FA;
}
}
}

.mx_ReadReceiptGroup_remainder {
color: #737D8C;
font-size: $font-11px;
line-height: $font-16px;
margin-right: 8px;
}

.mx_ReadReceiptGroup_container {
position: relative;
display: block;
height: 100%;
width: 36px;

.mx_BaseAvatar {
position: absolute;
display: inline-block;
height: 14px;
width: 14px;
border: 1px solid #fff;
border-radius: 100%;

will-change: left, top;
transition:
left var(--transition-short) ease-out,
top var(--transition-standard) ease-out;
}
}
}

.mx_ReadReceiptGroup_popup {
max-height: 300px;
width: 220px;
background: #F4F6FA;
border-radius: 8px;
display: flex;
flex-direction: column;
text-align: left;
font-size: 12px;
line-height: 15px;

right: 0;

&.mx_ContextualMenu_top {
top: 8px;
}

&.mx_ContextualMenu_bottom {
bottom: 8px;
}

.mx_ReadReceiptGroup_title {
font-size: 12px;
line-height: 15px;
margin: 16px 16px 8px;
font-weight: 600;
// shouldn’t be actually focusable
outline: none;
}

.mx_AutoHideScrollbar {
> :last-child {
margin-bottom: 8px;
}

.mx_ReadReceiptGroup_person {
display: flex;
flex-direction: row;
padding: 4px;
margin: 0 12px;
border-radius: 8px;

&:hover {
background: #E3E8F0;
}

.mx_BaseAvatar {
margin: 6px 8px;
align-self: center;
justify-self: center;
}

.mx_ReadReceiptGroup_name {
display: flex;
flex-direction: column;
flex-grow: 1;
flex-shrink: 1;
overflow: hidden;

p {
margin: 2px 0;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}

.mx_ReadReceiptGroup_secondary {
color: #737D8C;
}
}
}
}
}
3 changes: 2 additions & 1 deletion src/components/views/avatars/MemberAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ interface IProps extends Omit<React.ComponentProps<typeof BaseAvatar>, "name" |
title?: string;
style?: any;
forceHistorical?: boolean; // true to deny `feature_use_only_current_profiles` usage. Default false.
hideTitle?: boolean;
}

interface IState {
Expand Down Expand Up @@ -124,7 +125,7 @@ export default class MemberAvatar extends React.PureComponent<IProps, IState> {
<BaseAvatar
{...otherProps}
name={this.state.name}
title={this.state.title}
title={this.props.hideTitle ? undefined : this.state.title}
idName={userId}
url={this.state.imageUrl}
onClick={onClick}
Expand Down
Loading

0 comments on commit 7acae00

Please sign in to comment.