Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 0 additions & 29 deletions res/css/views/settings/tabs/room/_NotificationSettingsTab.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,8 @@ Please see LICENSE files in the repository root for full details.
font-weight: var(--cpd-font-weight-semibold);
margin-top: 16px;
position: relative;
padding-left: 8px;
align-items: center;

&::before {
content: "";
position: absolute;
height: 24px;
width: 24px;
left: 0;
mask-repeat: no-repeat;
mask-position: center;
mask-size: contain;
background-color: $secondary-content;
}

input + div {
margin-top: 8px;
}
Expand All @@ -44,22 +31,6 @@ Please see LICENSE files in the repository root for full details.
margin-right: 32px;
}
}

.mx_NotificationSettingsTab_defaultEntry::before {
mask-image: url("$(res)/img/element-icons/notifications.svg");
}

.mx_NotificationSettingsTab_allMessagesEntry::before {
mask-image: url("$(res)/img/element-icons/roomlist/notifications-default.svg");
}

.mx_NotificationSettingsTab_mentionsKeywordsEntry::before {
mask-image: url("$(res)/img/element-icons/roomlist/notifications-dm.svg");
}

.mx_NotificationSettingsTab_noneEntry::before {
mask-image: url("$(res)/img/element-icons/roomlist/notifications-off.svg");
}
}

input[type="file"].mx_NotificationSound_soundUpload {
Expand Down
5 changes: 0 additions & 5 deletions res/img/element-icons/notifications.svg

This file was deleted.

5 changes: 0 additions & 5 deletions res/img/element-icons/roomlist/notifications-default.svg

This file was deleted.

3 changes: 0 additions & 3 deletions res/img/element-icons/roomlist/notifications-dm.svg

This file was deleted.

7 changes: 0 additions & 7 deletions res/img/element-icons/roomlist/notifications-off.svg

This file was deleted.

4 changes: 2 additions & 2 deletions src/components/structures/UserMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
QrCodeIcon,
SettingsSolidIcon,
LeaveIcon,
NotificationsSolidIcon,
} from "@vector-im/compound-design-tokens/assets/web/icons";

import { MatrixClientPeg } from "../../MatrixClientPeg";
Expand Down Expand Up @@ -51,7 +52,6 @@ import { type ViewHomePagePayload } from "../../dispatcher/payloads/ViewHomePage
import { SDKContext } from "../../contexts/SDKContext";
import { shouldShowFeedback } from "../../utils/Feedback";
import { Icon as DarkLightModeSvg } from "../../../res/img/element-icons/roomlist/dark-light-mode.svg";
import { Icon as NotificationsIcon } from "../../../res/img/element-icons/notifications.svg";

interface IProps {
isPanelCollapsed: boolean;
Expand Down Expand Up @@ -337,7 +337,7 @@ export default class UserMenu extends React.Component<IProps, IState> {
{homeButton}
{linkNewDeviceButton}
<IconizedContextMenuOption
icon={<NotificationsIcon />}
icon={<NotificationsSolidIcon />}
label={_t("notifications|enable_prompt_toast_title")}
onClick={(e) => this.onSettingsOpen(e, UserTab.Notifications)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ import IconizedContextMenu, {
IconizedContextMenuRadio,
} from "../context_menus/IconizedContextMenu";
import { type ButtonEvent } from "../elements/AccessibleButton";
import { Icon as NotificationsIcon } from "../../../../res/img/element-icons/notifications.svg";
import { Icon as NotificationsDefaultIcon } from "../../../../res/img/element-icons/roomlist/notifications-default.svg";
import { Icon as NotificationsDmIcon } from "../../../../res/img/element-icons/roomlist/notifications-dm.svg";
import { Icon as NotificationsOffIcon } from "../../../../res/img/element-icons/roomlist/notifications-off.svg";

interface IProps extends IContextMenuProps {
room: Room;
Expand All @@ -50,7 +46,6 @@ export const RoomNotificationContextMenu: React.FC<IProps> = ({ room, onFinished
<IconizedContextMenuRadio
label={_t("room|context_menu|notifications_default")}
active={notificationState === RoomNotifState.AllMessages}
icon={<NotificationsIcon />}
onClick={wrapHandler(() => setNotificationState(RoomNotifState.AllMessages))}
/>
);
Expand All @@ -59,7 +54,6 @@ export const RoomNotificationContextMenu: React.FC<IProps> = ({ room, onFinished
<IconizedContextMenuRadio
label={_t("notifications|all_messages")}
active={notificationState === RoomNotifState.AllMessagesLoud}
icon={<NotificationsDefaultIcon />}
onClick={wrapHandler(() => setNotificationState(RoomNotifState.AllMessagesLoud))}
/>
);
Expand All @@ -68,7 +62,6 @@ export const RoomNotificationContextMenu: React.FC<IProps> = ({ room, onFinished
<IconizedContextMenuRadio
label={_t("notifications|mentions_keywords")}
active={notificationState === RoomNotifState.MentionsOnly}
icon={<NotificationsDmIcon />}
onClick={wrapHandler(() => setNotificationState(RoomNotifState.MentionsOnly))}
/>
);
Expand All @@ -77,7 +70,6 @@ export const RoomNotificationContextMenu: React.FC<IProps> = ({ room, onFinished
<IconizedContextMenuRadio
label={_t("room|context_menu|notifications_mute")}
active={notificationState === RoomNotifState.Mute}
icon={<NotificationsOffIcon />}
onClick={wrapHandler(() => setNotificationState(RoomNotifState.Mute))}
/>
);
Expand Down
25 changes: 12 additions & 13 deletions src/components/views/dialogs/spotlight/RoomResultContextMenus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ Please see LICENSE files in the repository root for full details.
*/

import { type Room } from "matrix-js-sdk/src/matrix";
import React, { type JSX, Fragment, useState, type ReactNode } from "react";
import { OverflowHorizontalIcon } from "@vector-im/compound-design-tokens/assets/web/icons";
import React, { Fragment, type JSX, type ReactNode, useState } from "react";
import {
NotificationsOffSolidIcon,
OverflowHorizontalIcon,
NotificationsSolidIcon,
} from "@vector-im/compound-design-tokens/assets/web/icons";

import { ContextMenuTooltipButton } from "../../../../accessibility/context_menu/ContextMenuTooltipButton";
import { useNotificationState } from "../../../../hooks/useRoomNotificationState";
Expand All @@ -21,23 +25,18 @@ import { type ButtonEvent } from "../../elements/AccessibleButton";
import { contextMenuBelow } from "../../rooms/RoomTile";
import { shouldShowComponent } from "../../../../customisations/helpers/UIComponents";
import { UIComponent } from "../../../../settings/UIFeature";
import { Icon as NotificationsIcon } from "../../../../../res/img/element-icons/notifications.svg";
import { Icon as NotificationsDefaultIcon } from "../../../../../res/img/element-icons/roomlist/notifications-default.svg";
import { Icon as NotificationsDmIcon } from "../../../../../res/img/element-icons/roomlist/notifications-dm.svg";
import { Icon as NotificationsOffIcon } from "../../../../../res/img/element-icons/roomlist/notifications-off.svg";

interface Props {
room: Room;
}

export function getNotificationIcon(state: RoomNotifState): ReactNode {
const icons: Record<RoomNotifState, JSX.Element> = {
[RoomNotifState.AllMessages]: <NotificationsIcon />,
[RoomNotifState.AllMessagesLoud]: <NotificationsDefaultIcon />,
[RoomNotifState.MentionsOnly]: <NotificationsDmIcon />,
[RoomNotifState.Mute]: <NotificationsOffIcon />,
};
return icons[state];
switch (state) {
case RoomNotifState.Mute:
return <NotificationsOffSolidIcon />;
default:
return <NotificationsSolidIcon />;
}
}

export function RoomResultContextMenus({ room }: Props): JSX.Element {
Expand Down
22 changes: 12 additions & 10 deletions src/components/views/rooms/NotificationDecoration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
*/

import React, { type HTMLProps, type JSX } from "react";
import MentionIcon from "@vector-im/compound-design-tokens/assets/web/icons/mention";
import ErrorIcon from "@vector-im/compound-design-tokens/assets/web/icons/error-solid";
import NotificationOffIcon from "@vector-im/compound-design-tokens/assets/web/icons/notifications-off-solid";
import VideoCallIcon from "@vector-im/compound-design-tokens/assets/web/icons/video-call-solid";
import EmailIcon from "@vector-im/compound-design-tokens/assets/web/icons/email-solid";
import {
MentionIcon,
ErrorIcon,
NotificationsOffSolidIcon,
VideoCallSolidIcon,
EmailSolidIcon,
VoiceCallSolidIcon,
} from "@vector-im/compound-design-tokens/assets/web/icons";
import { UnreadCounter, Unread } from "@vector-im/compound-web";
import VoiceCallIcon from "@vector-im/compound-design-tokens/assets/web/icons/voice-call-solid";
import { CallType } from "matrix-js-sdk/src/webrtc/call";
import { Flex } from "@element-hq/web-shared-components";

Expand Down Expand Up @@ -72,16 +74,16 @@ export function NotificationDecoration({
>
{isUnsentMessage && <ErrorIcon width="20px" height="20px" fill="var(--cpd-color-icon-critical-primary)" />}
{callType === CallType.Video && (
<VideoCallIcon width="20px" height="20px" fill="var(--cpd-color-icon-accent-primary)" />
<VideoCallSolidIcon width="20px" height="20px" fill="var(--cpd-color-icon-accent-primary)" />
)}
{callType === CallType.Voice && (
<VoiceCallIcon width="20px" height="20px" fill="var(--cpd-color-icon-accent-primary)" />
<VoiceCallSolidIcon width="20px" height="20px" fill="var(--cpd-color-icon-accent-primary)" />
)}
{invited && <EmailIcon width="20px" height="20px" fill="var(--cpd-color-icon-accent-primary)" />}
{invited && <EmailSolidIcon width="20px" height="20px" fill="var(--cpd-color-icon-accent-primary)" />}
{isMention && <MentionIcon width="20px" height="20px" fill="var(--cpd-color-icon-accent-primary)" />}
{(isMention || isNotification) && <UnreadCounter count={count || null} />}
{isActivityNotification && <Unread />}
{muted && <NotificationOffIcon width="20px" height="20px" fill="var(--cpd-color-icon-tertiary)" />}
{muted && <NotificationsOffSolidIcon width="20px" height="20px" fill="var(--cpd-color-icon-tertiary)" />}
</Flex>
);
}
28 changes: 15 additions & 13 deletions src/components/views/rooms/RoomListPanel/RoomListItemMenuView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@

import React, { type JSX, useState } from "react";
import { IconButton, Menu, MenuItem, Separator, ToggleMenuItem } from "@vector-im/compound-web";
import MarkAsReadIcon from "@vector-im/compound-design-tokens/assets/web/icons/mark-as-read";
import MarkAsUnreadIcon from "@vector-im/compound-design-tokens/assets/web/icons/mark-as-unread";
import FavouriteIcon from "@vector-im/compound-design-tokens/assets/web/icons/favourite";
import ArrowDownIcon from "@vector-im/compound-design-tokens/assets/web/icons/arrow-down";
import UserAddIcon from "@vector-im/compound-design-tokens/assets/web/icons/user-add";
import LinkIcon from "@vector-im/compound-design-tokens/assets/web/icons/link";
import LeaveIcon from "@vector-im/compound-design-tokens/assets/web/icons/leave";
import OverflowIcon from "@vector-im/compound-design-tokens/assets/web/icons/overflow-horizontal";
import NotificationIcon from "@vector-im/compound-design-tokens/assets/web/icons/notifications-solid";
import NotificationOffIcon from "@vector-im/compound-design-tokens/assets/web/icons/notifications-off-solid";
import CheckIcon from "@vector-im/compound-design-tokens/assets/web/icons/check";
import {
MarkAsReadIcon,
MarkAsUnreadIcon,
FavouriteIcon,
ArrowDownIcon,
UserAddIcon,
LinkIcon,
LeaveIcon,
OverflowHorizontalIcon,
NotificationsSolidIcon,
NotificationsOffSolidIcon,
CheckIcon,
} from "@vector-im/compound-design-tokens/assets/web/icons";
import { type Room } from "matrix-js-sdk/src/matrix";
import { Flex } from "@element-hq/web-shared-components";
import classNames from "classnames";
Expand Down Expand Up @@ -81,7 +83,7 @@ function MoreOptionsMenu({ vm }: MoreOptionsMenuProps): JSX.Element {
aria-label={_t("room_list|room|more_options")}
size="24px"
>
<OverflowIcon />
<OverflowHorizontalIcon />
</IconButton>
}
>
Expand Down Expand Up @@ -190,7 +192,7 @@ function NotificationMenu({ vm }: NotificationMenuProps): JSX.Element {
tooltip={_t("room_list|notification_options")}
aria-label={_t("room_list|notification_options")}
>
{vm.isNotificationMute ? <NotificationOffIcon /> : <NotificationIcon />}
{vm.isNotificationMute ? <NotificationsOffSolidIcon /> : <NotificationsSolidIcon />}
</IconButton>
}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ export default class NotificationsSettingsTab extends React.Component<IProps, IS
definitions={[
{
value: RoomNotifState.AllMessages,
className: "mx_NotificationSettingsTab_defaultEntry",
label: (
<>
{_t("notifications|default")}
Expand All @@ -195,7 +194,6 @@ export default class NotificationsSettingsTab extends React.Component<IProps, IS
},
{
value: RoomNotifState.AllMessagesLoud,
className: "mx_NotificationSettingsTab_allMessagesEntry",
label: (
<>
{_t("notifications|all_messages")}
Expand All @@ -207,7 +205,6 @@ export default class NotificationsSettingsTab extends React.Component<IProps, IS
},
{
value: RoomNotifState.MentionsOnly,
className: "mx_NotificationSettingsTab_mentionsKeywordsEntry",
label: (
<>
{_t("notifications|mentions_and_keywords")}
Expand All @@ -232,7 +229,6 @@ export default class NotificationsSettingsTab extends React.Component<IProps, IS
},
{
value: RoomNotifState.Mute,
className: "mx_NotificationSettingsTab_noneEntry",
label: (
<>
{_t("common|off")}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ exports[`<NotificationDecoration /> should render the unset message decoration 1
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M12 17q.424 0 .713-.288A.97.97 0 0 0 13 16a.97.97 0 0 0-.287-.713A.97.97 0 0 0 12 15a.97.97 0 0 0-.713.287A.97.97 0 0 0 11 16q0 .424.287.712.288.288.713.288m0-4q.424 0 .713-.287A.97.97 0 0 0 13 12V8a.97.97 0 0 0-.287-.713A.97.97 0 0 0 12 7a.97.97 0 0 0-.713.287A.97.97 0 0 0 11 8v4q0 .424.287.713.288.287.713.287m0 9a9.7 9.7 0 0 1-3.9-.788 10.1 10.1 0 0 1-3.175-2.137q-1.35-1.35-2.137-3.175A9.7 9.7 0 0 1 2 12q0-2.075.788-3.9a10.1 10.1 0 0 1 2.137-3.175q1.35-1.35 3.175-2.137A9.7 9.7 0 0 1 12 2q2.075 0 3.9.788a10.1 10.1 0 0 1 3.175 2.137q1.35 1.35 2.137 3.175A9.7 9.7 0 0 1 22 12a9.7 9.7 0 0 1-.788 3.9 10.1 10.1 0 0 1-2.137 3.175q-1.35 1.35-3.175 2.137A9.7 9.7 0 0 1 12 22"
d="M12 17q.424 0 .713-.288A.97.97 0 0 0 13 16a.97.97 0 0 0-.287-.713A.97.97 0 0 0 12 15a.97.97 0 0 0-.713.287A.97.97 0 0 0 11 16q0 .424.287.712.288.288.713.288m0-4q.424 0 .713-.287A.97.97 0 0 0 13 12V8a.97.97 0 0 0-.287-.713A.97.97 0 0 0 12 7a.97.97 0 0 0-.713.287A.97.97 0 0 0 11 8v4q0 .424.287.713.288.287.713.287m0 9a9.7 9.7 0 0 1-3.9-.788 10.1 10.1 0 0 1-3.175-2.137q-1.35-1.35-2.137-3.175A9.7 9.7 0 0 1 2 12q0-2.075.788-3.9a10.1 10.1 0 0 1 2.137-3.175q1.35-1.35 3.175-2.137A9.7 9.7 0 0 1 12 2q2.075 0 3.9.788a10.1 10.1 0 0 1 3.175 2.137q1.35 1.35 2.137 3.175A9.7 9.7 0 0 1 22 12a9.7 9.7 0 0 1-.788 3.9 10.1 10.1 0 0 1-2.137 3.175q-1.35 1.35-3.175 2.137A9.7 9.7 0 0 1 12 22m0-2q3.35 0 5.675-2.325T20 12t-2.325-5.675T12 4 6.325 6.325 4 12t2.325 5.675T12 20"
/>
</svg>
</div>
Expand Down
Loading
Loading