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

Commit d724696

Browse files
authored
Add unread badges and avatar decorations to spotlight search (#7696)
1 parent 30e80aa commit d724696

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

res/css/views/dialogs/_SpotlightDialog.scss

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,12 @@ limitations under the License.
146146
text-overflow: ellipsis;
147147
overflow: hidden;
148148

149-
.mx_BaseAvatar {
149+
.mx_DecoratedRoomAvatar {
150150
margin-right: 8px;
151-
display: inline-block;
152-
height: 20px;
151+
}
152+
153+
.mx_NotificationBadge {
154+
margin-left: 8px;
153155
}
154156

155157
&:hover, &[aria-selected=true] {

src/components/views/dialogs/SpotlightDialog.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import { IDialogProps } from "./IDialogProps";
3434
import { _t } from "../../../languageHandler";
3535
import BaseDialog from "./BaseDialog";
3636
import { BreadcrumbsStore } from "../../../stores/BreadcrumbsStore";
37-
import RoomAvatar from "../avatars/RoomAvatar";
3837
import defaultDispatcher from "../../../dispatcher/dispatcher";
3938
import {
4039
findSiblingElement,
@@ -63,6 +62,8 @@ import RoomViewStore from "../../../stores/RoomViewStore";
6362
import { showStartChatInviteDialog } from "../../../RoomInvite";
6463
import SettingsStore from "../../../settings/SettingsStore";
6564
import { SettingLevel } from "../../../settings/SettingLevel";
65+
import NotificationBadge from "../rooms/NotificationBadge";
66+
import { RoomNotificationStateStore } from "../../../stores/notifications/RoomNotificationStateStore";
6667

6768
const MAX_RECENT_SEARCHES = 10;
6869
const SECTION_LIMIT = 50; // only show 50 results per section for performance reasons
@@ -244,8 +245,9 @@ const SpotlightDialog: React.FC<IProps> = ({ initialText = "", onFinished }) =>
244245
viewRoom(room.roomId, true);
245246
}}
246247
>
247-
<RoomAvatar room={room} width={20} height={20} />
248+
<DecoratedRoomAvatar room={room} avatarSize={20} />
248249
{ room.name }
250+
<NotificationBadge notification={RoomNotificationStateStore.instance.getRoomState(room)} />
249251
<ResultDetails room={room} />
250252
<div className="mx_SpotlightDialog_enterPrompt"></div>
251253
</Option>
@@ -383,8 +385,9 @@ const SpotlightDialog: React.FC<IProps> = ({ initialText = "", onFinished }) =>
383385
viewRoom(room.roomId, true);
384386
}}
385387
>
386-
<RoomAvatar room={room} width={20} height={20} />
388+
<DecoratedRoomAvatar room={room} avatarSize={20} />
387389
{ room.name }
390+
<NotificationBadge notification={RoomNotificationStateStore.instance.getRoomState(room)} />
388391
<div className="mx_SpotlightDialog_enterPrompt"></div>
389392
</Option>
390393
)) }

0 commit comments

Comments
 (0)