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

Commit cd17889

Browse files
committed
Merge branch 'develop' into madlittlemods/translatable-slash-command-errors
Conflicts: src/SlashCommands.tsx
2 parents 50ecd8c + 1e09599 commit cd17889

File tree

14 files changed

+287
-108
lines changed

14 files changed

+287
-108
lines changed

res/css/_components.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@
298298
@import "./views/toasts/_AnalyticsToast.scss";
299299
@import "./views/toasts/_IncomingCallToast.scss";
300300
@import "./views/toasts/_NonUrgentEchoFailureToast.scss";
301+
@import "./views/typography/_Heading.scss";
301302
@import "./views/verification/_VerificationShowSas.scss";
302303
@import "./views/voip/CallView/_CallViewButtons.scss";
303304
@import "./views/voip/_CallContainer.scss";

res/css/views/rooms/_Autocomplete.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
.mx_Autocomplete_Completion_block {
2323
min-height: 34px;
2424
display: flex;
25+
flex-wrap: wrap;
2526
padding: 0 12px;
2627
user-select: none;
2728
cursor: pointer;
@@ -57,6 +58,7 @@
5758

5859
.mx_Autocomplete_Completion_description {
5960
color: gray;
61+
min-width: 150px;
6062
}
6163

6264
.mx_Autocomplete_Completion_container_pill {
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
Copyright 2021 The Matrix.org Foundation C.I.C.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
.mx_Heading_h1 {
18+
font-size: $font-32px;
19+
font-weight: $font-semi-bold;
20+
line-height: $font-39px;
21+
margin-inline: unset;
22+
margin-block: unset;
23+
}
24+
25+
.mx_Heading_h2 {
26+
font-size: $font-24px;
27+
font-weight: $font-semi-bold;
28+
line-height: $font-29px;
29+
margin-inline: unset;
30+
margin-block: unset;
31+
}
32+
33+
.mx_Heading_h3 {
34+
font-size: $font-18px;
35+
font-weight: $font-semi-bold;
36+
line-height: $font-22px;
37+
margin-inline: unset;
38+
margin-block: unset;
39+
}

src/BasePlatform.ts

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,36 @@ export default abstract class BasePlatform {
170170
*/
171171
abstract requestNotificationPermission(): Promise<string>;
172172

173-
abstract displayNotification(title: string, msg: string, avatarUrl: string, room: Room);
173+
public displayNotification(
174+
title: string,
175+
msg: string,
176+
avatarUrl: string,
177+
room: Room,
178+
ev?: MatrixEvent,
179+
): Notification {
180+
const notifBody = {
181+
body: msg,
182+
silent: true, // we play our own sounds
183+
};
184+
if (avatarUrl) notifBody['icon'] = avatarUrl;
185+
const notification = new window.Notification(title, notifBody);
186+
187+
notification.onclick = () => {
188+
const payload: ActionPayload = {
189+
action: Action.ViewRoom,
190+
room_id: room.roomId,
191+
};
192+
193+
if (ev.getThread()) {
194+
payload.event_id = ev.getId();
195+
}
196+
197+
dis.dispatch(payload);
198+
window.focus();
199+
};
200+
201+
return notification;
202+
}
174203

175204
loudNotification(ev: MatrixEvent, room: Room) {
176205
}

src/Notifier.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export const Notifier = {
122122
avatarUrl = Avatar.avatarUrlForMember(ev.sender, 40, 40, 'crop');
123123
}
124124

125-
const notif = plaf.displayNotification(title, msg, avatarUrl, room);
125+
const notif = plaf.displayNotification(title, msg, avatarUrl, room, ev);
126126

127127
// if displayNotification returns non-null, the platform supports
128128
// clearing notifications later, so keep track of this.
@@ -381,7 +381,7 @@ export const Notifier = {
381381
_evaluateEvent: function(ev: MatrixEvent) {
382382
const room = MatrixClientPeg.get().getRoom(ev.getRoomId());
383383
const actions = MatrixClientPeg.get().getPushActionsForEvent(ev);
384-
if (actions && actions.notify) {
384+
if (actions?.notify) {
385385
if (RoomViewStore.getRoomId() === room.roomId &&
386386
UserActivity.sharedInstance().userActiveRecently() &&
387387
!Modal.hasDialogs()

src/components/structures/AutoHideScrollbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ interface IProps extends Omit<HTMLAttributes<HTMLDivElement>, "onScroll"> {
2727
}
2828

2929
export default class AutoHideScrollbar extends React.Component<IProps> {
30-
private containerRef: React.RefObject<HTMLDivElement> = React.createRef();
30+
public readonly containerRef: React.RefObject<HTMLDivElement> = React.createRef();
3131

3232
public componentDidMount() {
3333
if (this.containerRef.current && this.props.onScroll) {

src/components/views/context_menus/RoomContextMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ const RoomContextMenu = ({ room, onFinished, ...props }: IProps) => {
213213
});
214214
onFinished();
215215
}}
216-
label={_t("Copy link")}
216+
label={_t("Copy room link")}
217217
iconClassName="mx_RoomTile_iconCopyLink"
218218
/>;
219219
}

0 commit comments

Comments
 (0)