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

Add unread badges and avatar decorations to spotlight search #7696

Merged
merged 5 commits into from
Feb 7, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions res/css/views/dialogs/_SpotlightDialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ limitations under the License.
height: 20px;
}

.mx_NotificationBadge {
margin-left: 8px;
}

&:hover, &[aria-selected=true] {
background-color: $system;
}
Expand Down
4 changes: 4 additions & 0 deletions src/components/views/dialogs/SpotlightDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ import RoomViewStore from "../../../stores/RoomViewStore";
import { showStartChatInviteDialog } from "../../../RoomInvite";
import SettingsStore from "../../../settings/SettingsStore";
import { SettingLevel } from "../../../settings/SettingLevel";
import NotificationBadge from "../rooms/NotificationBadge";
import { RoomNotificationStateStore } from "../../../stores/notifications/RoomNotificationStateStore";

const MAX_RECENT_SEARCHES = 10;
const SECTION_LIMIT = 50; // only show 50 results per section for performance reasons
Expand Down Expand Up @@ -258,6 +260,7 @@ const SpotlightDialog: React.FC<IProps> = ({ initialText = "", onFinished }) =>
>
<RoomAvatar room={room} width={20} height={20} />
{ room.name }
<NotificationBadge notification={RoomNotificationStateStore.instance.getRoomState(room)} />
<ResultDetails room={room} />
<div className="mx_SpotlightDialog_enterPrompt">↵</div>
</Option>
Expand Down Expand Up @@ -397,6 +400,7 @@ const SpotlightDialog: React.FC<IProps> = ({ initialText = "", onFinished }) =>
>
<RoomAvatar room={room} width={20} height={20} />
{ room.name }
<NotificationBadge notification={RoomNotificationStateStore.instance.getRoomState(room)} />
<div className="mx_SpotlightDialog_enterPrompt">↵</div>
</Option>
)) }
Expand Down