mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 09:25:27 +00:00
Add deafen button
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user