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

Commit 78a9841

Browse files
authored
Set common width, white-space, and display values to MessageTimestamp (#8818)
* Add mx_MessageTimestamp to mx_PinnedEventTile_timestamp Signed-off-by: Suguru Hirahara <[email protected]> * Apply display: block globally to enable the width declaration - Unset display and width value of timestamp on pinned messages card Signed-off-by: Suguru Hirahara <[email protected]> * Apply nowrap globally Signed-off-by: Suguru Hirahara <[email protected]> * MessageTimestamp on ThreadsList - Remove width setting and add font-size setting Signed-off-by: Suguru Hirahara <[email protected]> * Remove redundant font-size declaration from Threadview Signed-off-by: Suguru Hirahara <[email protected]> * Fix timestamp position of timestamp on ThreadView in IRC layout - GroupLayout is modern layout, not IRC layout Signed-off-by: Suguru Hirahara <[email protected]> * Remove redundant font-size declaration from IRC layout Signed-off-by: Suguru Hirahara <[email protected]> * Remove redundant color setting from timestamp on file panel Signed-off-by: Suguru Hirahara <[email protected]> * Cancel the default width to set a gap between the event tile line Signed-off-by: Suguru Hirahara <[email protected]> * Apply user-select: none globally Signed-off-by: Suguru Hirahara <[email protected]>
1 parent d4a4eea commit 78a9841

File tree

8 files changed

+17
-16
lines changed

8 files changed

+17
-16
lines changed

res/css/structures/_FilePanel.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ limitations under the License.
103103
position: initial;
104104
font-size: $font-14px;
105105
opacity: 1.0;
106-
color: $event-timestamp-color;
107106
}
108107

109108
/* Overrides for the wrappers around the body tile */

res/css/views/messages/_MessageTimestamp.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,13 @@ limitations under the License.
1515
*/
1616

1717
.mx_MessageTimestamp {
18+
--MessageTimestamp-max-width: 80px;
19+
1820
color: $event-timestamp-color;
1921
font-size: $font-10px;
2022
font-variant-numeric: tabular-nums;
23+
display: block; // enable the width setting below
2124
width: $MessageTimestamp_width;
25+
white-space: nowrap;
26+
user-select: none;
2227
}

res/css/views/right_panel/_ThreadPanel.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ limitations under the License.
121121
}
122122

123123
.mx_MessageTimestamp {
124-
font-size: $font-12px;
125124
color: $secondary-content;
126125
}
127126

res/css/views/rooms/_EventBubbleTile.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ limitations under the License.
6464
margin-left: var(--EventTile_bubble-margin-inline-start);
6565
font-size: $font-14px;
6666

67+
.mx_MessageTimestamp {
68+
width: unset; // Cancel the default width
69+
max-width: var(--MessageTimestamp-max-width);
70+
}
71+
6772
.mx_ThreadSummary {
6873
clear: both;
6974
width: fit-content;

res/css/views/rooms/_EventTile.scss

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,8 @@ $threadInfoLineHeight: calc(2 * $font-12px); // See: _commons.scss
219219
}
220220

221221
.mx_MessageTimestamp {
222-
display: block;
223-
white-space: nowrap;
224222
left: 0px;
225223
text-align: center;
226-
user-select: none;
227224
}
228225

229226
&.mx_EventTile_continuation .mx_EventTile_line {
@@ -861,8 +858,8 @@ $threadInfoLineHeight: calc(2 * $font-12px); // See: _commons.scss
861858
}
862859

863860
.mx_MessageTimestamp {
864-
max-width: 80px;
865-
width: auto;
861+
font-size: $font-12px;
862+
max-width: var(--MessageTimestamp-max-width);
866863
position: initial;
867864
}
868865
}
@@ -894,10 +891,6 @@ $threadInfoLineHeight: calc(2 * $font-12px); // See: _commons.scss
894891
padding-inline-end: 0;
895892
}
896893

897-
.mx_MessageTimestamp {
898-
font-size: $font-10px;
899-
}
900-
901894
// handling for hidden events (e.g reactions) in the thread view
902895
&.mx_EventTile_info {
903896
padding-top: 0;
@@ -1042,6 +1035,7 @@ $threadInfoLineHeight: calc(2 * $font-12px); // See: _commons.scss
10421035

10431036
.mx_MessageTimestamp {
10441037
top: 2px; // Align with mx_EventTile_content
1038+
position: absolute; // for IRC layout
10451039
}
10461040

10471041
.mx_EventTile_senderDetails {

res/css/views/rooms/_IRCLayout.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ $irc-line-height: $font-18px;
116116
}
117117

118118
.mx_MessageTimestamp {
119-
font-size: $font-10px;
120119
text-align: right;
121120
}
122121

res/css/views/rooms/_PinnedEventTile.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ limitations under the License.
8989

9090
.mx_PinnedEventTile_footer {
9191
grid-area: footer;
92-
font-size: 10px;
92+
font-size: $font-10px;
9393
line-height: 12px;
9494

9595
.mx_PinnedEventTile_timestamp {
96-
font-size: inherit;
97-
line-height: inherit;
9896
color: $secondary-content;
97+
display: unset;
98+
width: unset; // Cancel the default width value
9999
}
100100

101101
.mx_AccessibleButton_kind_link {

src/components/views/rooms/PinnedEventTile.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export default class PinnedEventTile extends React.Component<IProps> {
144144
</div>
145145

146146
<div className="mx_PinnedEventTile_footer">
147-
<span className="mx_PinnedEventTile_timestamp">
147+
<span className="mx_MessageTimestamp mx_PinnedEventTile_timestamp">
148148
{ formatDate(new Date(this.props.event.getTs())) }
149149
</span>
150150

0 commit comments

Comments
 (0)