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

Commit 7acae00

Browse files
committed
feat: implement new read receipt design
1 parent afac1a4 commit 7acae00

File tree

7 files changed

+327
-130
lines changed

7 files changed

+327
-130
lines changed

res/css/_components.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@
249249
@import "./views/rooms/_NotificationBadge.scss";
250250
@import "./views/rooms/_PinnedEventTile.scss";
251251
@import "./views/rooms/_PresenceLabel.scss";
252+
@import "./views/rooms/_ReadReceiptGroup.scss";
252253
@import "./views/rooms/_RecentlyViewedButton.scss";
253254
@import "./views/rooms/_ReplyPreview.scss";
254255
@import "./views/rooms/_ReplyTile.scss";

res/css/views/rooms/_EventTile.scss

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -355,37 +355,6 @@ $left-gutter: 64px;
355355
}
356356
}
357357

358-
.mx_EventTile_readAvatars {
359-
position: relative;
360-
display: inline-block;
361-
width: 14px;
362-
height: 14px;
363-
// This aligns the avatar with the last line of the
364-
// message. We want to move it one line up
365-
// See .mx_GroupLayout .mx_EventTile .mx_EventTile_line in _GroupLayout.scss
366-
top: -$font-22px;
367-
user-select: none;
368-
z-index: 1;
369-
}
370-
371-
.mx_EventTile_readAvatars .mx_BaseAvatar {
372-
position: absolute;
373-
display: inline-block;
374-
height: $font-14px;
375-
width: $font-14px;
376-
377-
will-change: left, top;
378-
transition:
379-
left var(--transition-short) ease-out,
380-
top var(--transition-standard) ease-out;
381-
}
382-
383-
.mx_EventTile_readAvatarRemainder {
384-
color: $event-timestamp-color;
385-
font-size: $font-11px;
386-
position: absolute;
387-
}
388-
389358
.mx_EventTile_bigEmoji {
390359
font-size: 48px;
391360
line-height: 57px;
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
.mx_ReadReceiptGroup {
2+
position: relative;
3+
display: inline-block;
4+
// This aligns the avatar with the last line of the
5+
// message. We want to move it one line up
6+
// See .mx_GroupLayout .mx_EventTile .mx_EventTile_line in _GroupLayout.scss
7+
top: calc(-$font-22px - 3px);
8+
user-select: none;
9+
z-index: 1;
10+
11+
.mx_ReadReceiptGroup_button {
12+
display: inline-flex;
13+
flex-direction: row;
14+
height: 16px;
15+
padding: 4px;
16+
border-radius: 6px;
17+
18+
&.mx_AccessibleButton {
19+
&:hover {
20+
background: #F4F6FA;
21+
}
22+
}
23+
}
24+
25+
.mx_ReadReceiptGroup_remainder {
26+
color: #737D8C;
27+
font-size: $font-11px;
28+
line-height: $font-16px;
29+
margin-right: 8px;
30+
}
31+
32+
.mx_ReadReceiptGroup_container {
33+
position: relative;
34+
display: block;
35+
height: 100%;
36+
width: 36px;
37+
38+
.mx_BaseAvatar {
39+
position: absolute;
40+
display: inline-block;
41+
height: 14px;
42+
width: 14px;
43+
border: 1px solid #fff;
44+
border-radius: 100%;
45+
46+
will-change: left, top;
47+
transition:
48+
left var(--transition-short) ease-out,
49+
top var(--transition-standard) ease-out;
50+
}
51+
}
52+
}
53+
54+
.mx_ReadReceiptGroup_popup {
55+
max-height: 300px;
56+
width: 220px;
57+
background: #F4F6FA;
58+
border-radius: 8px;
59+
display: flex;
60+
flex-direction: column;
61+
text-align: left;
62+
font-size: 12px;
63+
line-height: 15px;
64+
65+
right: 0;
66+
67+
&.mx_ContextualMenu_top {
68+
top: 8px;
69+
}
70+
71+
&.mx_ContextualMenu_bottom {
72+
bottom: 8px;
73+
}
74+
75+
.mx_ReadReceiptGroup_title {
76+
font-size: 12px;
77+
line-height: 15px;
78+
margin: 16px 16px 8px;
79+
font-weight: 600;
80+
// shouldn’t be actually focusable
81+
outline: none;
82+
}
83+
84+
.mx_AutoHideScrollbar {
85+
> :last-child {
86+
margin-bottom: 8px;
87+
}
88+
89+
.mx_ReadReceiptGroup_person {
90+
display: flex;
91+
flex-direction: row;
92+
padding: 4px;
93+
margin: 0 12px;
94+
border-radius: 8px;
95+
96+
&:hover {
97+
background: #E3E8F0;
98+
}
99+
100+
.mx_BaseAvatar {
101+
margin: 6px 8px;
102+
align-self: center;
103+
justify-self: center;
104+
}
105+
106+
.mx_ReadReceiptGroup_name {
107+
display: flex;
108+
flex-direction: column;
109+
flex-grow: 1;
110+
flex-shrink: 1;
111+
overflow: hidden;
112+
113+
p {
114+
margin: 2px 0;
115+
text-overflow: ellipsis;
116+
overflow: hidden;
117+
white-space: nowrap;
118+
}
119+
120+
.mx_ReadReceiptGroup_secondary {
121+
color: #737D8C;
122+
}
123+
}
124+
}
125+
}
126+
}

src/components/views/avatars/MemberAvatar.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ interface IProps extends Omit<React.ComponentProps<typeof BaseAvatar>, "name" |
4343
title?: string;
4444
style?: any;
4545
forceHistorical?: boolean; // true to deny `feature_use_only_current_profiles` usage. Default false.
46+
hideTitle?: boolean;
4647
}
4748

4849
interface IState {
@@ -124,7 +125,7 @@ export default class MemberAvatar extends React.PureComponent<IProps, IState> {
124125
<BaseAvatar
125126
{...otherProps}
126127
name={this.state.name}
127-
title={this.state.title}
128+
title={this.props.hideTitle ? undefined : this.state.title}
128129
idName={userId}
129130
url={this.state.imageUrl}
130131
onClick={onClick}

0 commit comments

Comments
 (0)