From aec0dc85ca5a7a6d51a55a1007548e8ee8b96ed1 Mon Sep 17 00:00:00 2001 From: Nikki Sharpley Date: Tue, 4 Jul 2023 15:15:32 -0400 Subject: [PATCH] Change muted text to icon --- src/react-components/icons/UserSoundOff.svg | 11 +++++++++ src/react-components/icons/UserSoundOn.svg | 4 +++ src/react-components/room/PeopleSidebar.js | 26 +++++++++++++++----- src/react-components/room/PeopleSidebar.scss | 5 ---- 4 files changed, 35 insertions(+), 11 deletions(-) create mode 100644 src/react-components/icons/UserSoundOff.svg create mode 100644 src/react-components/icons/UserSoundOn.svg diff --git a/src/react-components/icons/UserSoundOff.svg b/src/react-components/icons/UserSoundOff.svg new file mode 100644 index 0000000000..6ccf1455fd --- /dev/null +++ b/src/react-components/icons/UserSoundOff.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/react-components/icons/UserSoundOn.svg b/src/react-components/icons/UserSoundOn.svg new file mode 100644 index 0000000000..d696583e54 --- /dev/null +++ b/src/react-components/icons/UserSoundOn.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/react-components/room/PeopleSidebar.js b/src/react-components/room/PeopleSidebar.js index 063aefef59..33078c6c07 100644 --- a/src/react-components/room/PeopleSidebar.js +++ b/src/react-components/room/PeopleSidebar.js @@ -1,5 +1,6 @@ import React from "react"; import PropTypes from "prop-types"; +import { ToolTip } from "@mozilla/lilypad-ui"; import styles from "./PeopleSidebar.scss"; import { Sidebar } from "../sidebar/Sidebar"; import { CloseButton } from "../input/CloseButton"; @@ -13,10 +14,17 @@ import { ReactComponent as VolumeOffIcon } from "../icons/VolumeOff.svg"; import { ReactComponent as VolumeHighIcon } from "../icons/VolumeHigh.svg"; import { ReactComponent as VolumeMutedIcon } from "../icons/VolumeMuted.svg"; import { ReactComponent as HandRaisedIcon } from "../icons/HandRaised.svg"; +import { ReactComponent as UserSoundOnIcon } from "../icons/UserSoundOn.svg"; +import { ReactComponent as UserSoundOffIcon } from "../icons/UserSoundOff.svg"; import { List, ButtonListItem } from "../layout/List"; -import { FormattedMessage, useIntl } from "react-intl"; +import { FormattedMessage, defineMessage, useIntl } from "react-intl"; import { PermissionNotification } from "./PermissionNotifications"; +const toolTipDescription = defineMessage({ + id: "people-sidebar.muted-tooltip", + defaultMessage: "User is {mutedState}" +}); + function getDeviceLabel(ctx, intl) { if (ctx) { if (ctx.hmd) { @@ -112,6 +120,10 @@ export function PeopleSidebar({ me && filteredPeople.unshift(me); const store = window.APP.store; + function getToolTipDescription(isMuted) { + return intl.formatMessage(toolTipDescription, { mutedState: isMuted ? "muted" : "not muted" }); + } + return ( } {} {!person.context.discord && VoiceIcon && } + + {store._preferences?.avatarVoiceLevels?.[person.id]?.muted ? ( + + ) : ( + + )} +

{getPersonName(person, intl)}

{person.roles.owner && ( )} - {store._preferences?.avatarVoiceLevels?.[person.id]?.muted && ( - - {intl.formatMessage({ id: "people-sidebar.muted-label", defaultMessage: "muted" })} - - )}

{getPresenceMessage(person.presence, intl)}

); diff --git a/src/react-components/room/PeopleSidebar.scss b/src/react-components/room/PeopleSidebar.scss index 2b0d2ba36d..ee3020ae6c 100644 --- a/src/react-components/room/PeopleSidebar.scss +++ b/src/react-components/room/PeopleSidebar.scss @@ -22,8 +22,3 @@ flex: 1; justify-content: flex-end; } - -:local(.isMuted) { - font-style: italic; - color: theme.$color-semantic-warning; -}