Add deafen button

This commit is contained in:
Ryan Alexander
2021-08-22 12:22:44 +10:00
parent af99c7e1fd
commit b71208e6a8
7 changed files with 124 additions and 16 deletions

View File

@@ -12,12 +12,12 @@ import { AppContext, useClient } from "../../../context/revoltjs/RevoltClient";
import IconBase, { IconBaseProps } from "../IconBase";
import fallback from "../assets/user.png";
import {VolumeMute} from "@styled-icons/boxicons-solid";
type VoiceStatus = "muted";
interface Props extends IconBaseProps<User> {
mask?: string;
status?: boolean;
voice?: VoiceStatus;
voice?: string;
showServerIdentity?: boolean;
}
@@ -33,7 +33,7 @@ export function useStatusColour(user?: User) {
: theme["status-invisible"];
}
const VoiceIndicator = styled.div<{ status: VoiceStatus }>`
const VoiceIndicator = styled.div<{ status: string }>`
width: 10px;
height: 10px;
border-radius: var(--border-radius-half);
@@ -47,7 +47,7 @@ const VoiceIndicator = styled.div<{ status: VoiceStatus }>`
}
${(props) =>
props.status === "muted" &&
(props.status === "muted" || props.status === "deaf") &&
css`
background: var(--error);
`}
@@ -125,7 +125,9 @@ export default observer(
{props.voice && (
<foreignObject x="22" y="22" width="10" height="10">
<VoiceIndicator status={props.voice}>
{props.voice === "muted" && (
{props.voice === "deaf" && (
<VolumeMute size={6} />
) ||props.voice === "muted" && (
<MicrophoneOff size={6} />
)}
</VoiceIndicator>